ssrs shows errors after subreport in maIn report - reporting-services

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

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 2008 R2 Subreport Displays Only on First Page

Long time browser of this site, but first time poster. Normally I'm able to find the answer I need by searching, but in this case I haven't been able to, and it's driving me nuts!
I'm using BIDS / SSRS 2008 R2 to create a membership renewal form which my business will mail out to our customers. The form contains customer information, including membership dues / subscription info and other billing details.
In order to accomplish this,
I have built three RDLs:
Main report (this is one the users run). Contains base data set
(let's call it Proc 1), which requires an expiration date only, to
pull a list of member IDs and corresponding physical information
(address, phone, membership type, etc.) Contains the first subreport,
in a list, grouped by member ID.
One subreport for the first page in the main report. Contains a
set of parameters for each field it needs. Rather than execute Proc 1
again, I pass Proc 1's output from the main report to this subreport.
Everything in this subreport is also contained within a list, grouped
by member ID parameter (passed from main report).
Another subreport, nested within the first subreport, which pulls
subscription information. First subreport passes member ID and paid
through date to detail data set in nested subreport (let's call it
Proc 2). Proc 2 requires paid through date from page one subreport,
and ONE member ID, which it gets from its parent report. It displays
this information in a table, not grouped, since it should only be
receiving one ID at a time--- being that its parent subreport. and the
main report. are already grouped. However, I have tried grouping the
table based on member ID, and it didn't make a difference.
I found this approach necessary, because of the fact that I had two write two separate stored procs: one to pull the basic data, and one to pull detailed billing data. It's impossible to combine the two without creating duplicate rows. And of course, it's not possible to have a tablix assigned to a different data set than the list it is contained within. Hence the need for a subreport. I hope that all makes sense.
Anyway, my issue is that the nested subreport only displays data for the first customer. In fact, it doesn't display the nested subreport AT ALL for the rest of the customers. It's as if the nested subreport is only being passed the first member ID, but I don't see how that's possible given the grouping? Note that I am not using any FIRST or aggregate functions in the proc or report expressions. And I can execute each report file just fine individually.
I have tried creating a dummy data set in the nested subreport (ex. SELECT 'Nothing' AS Nothing) and adding it to a text box, thinking that this would force the nested subreport to display, but it STILL doesn't. Thoughts on what I might be doing wrong? Thanks in advance.
https://social.msdn.microsoft.com/Forums/en-US/9f8b9c42-90cb-4620-ad91-9754029ed4db/seemingly-random-error-subreport-could-not-be-shown-in-a-report-with-nested-subreports-ssrs?forum=sqlreportingservices
Your nested subreport could be throwing an error that your not seeing.
Quote
The known issue in SQL Server 2008 Reporting Services described in http://support.microsoft.com/kb/967749 should be fixed in SQL Server 2008 R2. Generally, the issue occurs because the parameter value is not passed to the subreport correctly or the subreport is not valid due to the specific values passed to the subreport.
I think you should add a detail group then put the subreport in that cell. Make sure the grouping is working correctly and pass the right values to the subreport.

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!