Unlinked subreport is creating duplicate records in the main crystal report - duplicates

I have an unlinked subreport in the report footer of the main report but for each record in this subreport, the records of the main report is getting duplicated. As it is an unlinked subreport, this should not happen. Could anyone tell what can be the reason?

Subreports cannot impact record selection for main reports.
You can verify by removing the subreport.
Most likely, the record duplication is caused by the table joins in the main report data source definition.

Related

How to populate an rdl table based on data returned from a query?

I have absolutely no experience working with rdl files and I received a ticket from a client asking us to display multiple reports in one report. What I have done so far is created a master rdl file that contains a sub-report. That subreport is linked to another rdl file which is the actual report that is normally generated. What I want to do is generate a list of those subreports based on the data received in an array from a query. So if there are 6 elements in the array then I need to have 6 subreports generated, with each report using data from the appropriate index in the array.
I managed to figure out how to connect the data for one subreport but I have no idea how to scale that programatically.
The basic steps are
Create a subreport that accepts parameters (done I guess)
Create a master report (done)
Create a dataset in your master report that contains a row of data for each subreport. For example. If you subreport showed employee details for a single employee, your main report might contain a dataset that lists employee IDs for a department.
Add a tablix to your main report, remove header row and leave only a single column. Stretch this column to fit your report width
Set the datasetname property of the tablix to the name of your dataset, (now it will produce one row per employee)
Right click the tablix cell and insert subreport
Right click the subreport placeholder -> properties then choose your subreport form the drop down.
Set the subreport parameter(s) to be the values from your dataset (e.g. EmployeeID = empID)
That's it.
You main report will run, the tablix will create a row per record in your dataset, this in turn will give you a subreport per row in your dataset, each of those subreports will have the value of the field from that row passed to it.
If you need more help, I'll try to track down a similar answer I posted a while back which had more detail.

SSRS Report - using the value from the subreport in a calculation in my main report

I am writing an SSRS report using report builder and have my main report and a sub report - I have had to do this because one of the figures is in a different table. The main report shows a customer column an amount column then my subreport column - in the next column I need to show these two figures added together, there is then a further column with another figure in and the final column will deduct the fourth from the calculated third - I dont know how to write an expression which incorporates the subreport value.
You can't retrieve values from a subreport like you wish as that's not how subreports work.
When you run the SSRS report, the parent report passes parameters to the sub-report (the only data transfer between the two), the subreport is rendered and then the rendered subreport is inserted back into the parent report as the parent report is rendered.
As I see it, you have two options to tackle the problem.
1) Join the data from the two tables in your source query so that all the appropriate information is within one dataset in your report.
2) Use the Lookup function to retrieve values from the second dataset. This is a very flexible option and one that I highly recommend that you review for scenarios like this.

SSRS supress MAIN report based on condition, go directly to subreport 1 or 2

Ok, LOTS of info out there on hiding sub-reports but we need to hide the main report or rather, when the report is ran for SOME customers that have a default "Condition" the report automatically goes directly to the sub report 2.
We have the reports built the same for every customer....this report is designed to be broken down based on division. Some customers do not have division details so we set these tables\columns to a default which allows the main report to function by drilling down. For these customers though that do not use division data, the main (and in this case 1st sub-report) are basically worthless. We would like to set a condition that when the report is RAN by the customer, the MAIN and 1st sub-report are skipped based on default values for the division information. It really doesnt matter that there are 2 sub-reports I guess, we just need to know how to ignore the primary report if this is possible.
Thanks
I would move all the "MAIN" report content to a new subreport, and convert the "MAIN" report to be an empty shell, containing only subreports.

ssrs shows errors after subreport in maIn report

I have a simple main report and a subreport. The subreport uses two parameters which I set up by selecting the values from the drop downs on the parameters screen. The main report contains one set of patient information in several tables in a list. The subreport contains additional details that run off a different data set.
When I run the main report, the subreport runs correctly except that after the last record, there is a repeating error message: "One or more parameters were not specified for the subreport, [Subreport Name] Sub Report. This number of times this message repeats before the next record in the main report varies from patient to patient.
I have validated what's being returned in the subreport when the main report is run by running the sub report separately. The sub report correctly shows all of the data for each patient. Nothing is missing.
I checked that none of the parameters had a list of available values or default values.
I experimented with hardcoding the values passed to the subreport and this resulted in no error messages displaying.
Scratching my head over this one.
Figured it out. I was using a table object and putting the subreport in the detail row. I tried using the same grouping as the list but it still returned multiple records.
I deleted the table and replaced it with a matrix. This resolved the problem
You are not returning exact number of parameters from your main report to your subreport. Like you have defined more parameters in subreport properties and they are not returning from main report

SSRS 2008 R2 Subreport Will Not Display

I've looked through all the other topics on this subject but I cannot find an answer. I have a report that utilizes a dataset that runs a stored procedure. That SP returns two rows, both of which I can display in a table in the report. So far so good.
Next, I added a tablix which uses the same dataset. In the (only cell in the) detail row of the tablix I added a subreport. I added the parameters to the subreport (four of which come from the dataset and one of which comes from a main report parameter). I created a row group tied to an Id column on the dataset.
What I expect to see when I run the main report: two instances of the subreport, one for each of the two rows returned by the SP.
What I actually see: In ReportBuilder I only get the first instance of the subreport. If I call the report service from an application (rendering it as a .PDF) nothing of the subreport shows at all. In either environment, there are no errors showing in the report.
What I've checked: I made sure all the various visibility options in the tablix, the row group, the subreport, etc. were set to always show. I also added some text to the subreport's NoRowsMessageproperty. That text is shown (one for each row) for the subreport when I try to run it from the Report Service. Why this would happen I also don't know, as the parameter values I supply are identical in both cases.
My guess is that I've got something wrong in the way I'm doing the row group, but I don't know what it is.
In the end I just created a new (blank) report and recreated the tablix. Even though I used the same data source/row group/parameters, etc. it worked just fine. I have no idea why. I copied the working tablix in to the broken report and it still didn't render correctly. Again, I have no idea why. However, I got it working by just starting over. Thanks for all the answers.
Try putting the subreport in a rectangle, I did a report that way in which the subreport pagebreaked after each instance.
I would make sure the rectangle with the subreport in it is under the group row in your tablix.
Cheers!