Forum Discussion
SSRS Subreport not showing
- Anonymous1 year ago
Hi, jdc136
Thank you very much for your reply. Here are the full demo processes, you can try to follow them:
For the Sub1 report I set it up as follows:
For the Sub2 report I set it up as follows:
For the main report, I set the following:
It delivers the results you're looking for:
In order to be able to get multiple choices, I use the IN keyword in my query here. Also add a dataset Year to the main report:
Modify the year parameter of the main report as follows:
Here are the results:
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, jdc136
Thank you very much for this information. First, I reproduced the error in your post:
Exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportProcessing+DataCacheUnavailableException' was thrown.
----------------------------
The data cache for the report edit session is not valid. Rerun the report to create a new and valid data cache. (rsDataCacheMismatch)
Dynamic parameter :
I guess you applied this Dynamic parameter in the filter panel of the Main dataset, causing this issue.
You can do this by adding a Year dataset to each report:
The two subreports will display as expected:
Of course, when I select a data item that the main report has but the subreport doesn't, it causes the subreport query to fail, which is normal. This is because this value does not exist in the parameters of the subreport.
To solve this problem, we need to carry the parameters of the subreport in the query, not in the filter panel:
The primary dataset still needs to set an available value in order to pass it to the subreports.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous thank you for getting back to me again! So for additional information, this is the setup I have. Here is what one of my subreports looks like:
You can see I have a parameter tied to a parameter in the "Main" dataset. The Tablix showing the results from the main dataset has a NoRowsMessage property entered.
If I enter the year "2024" for this particular report, I get the NoRowsMessage:
Here is the main report that contains a reference to this report as a subreport:
You can see that I have my report parameter and am passing it to the subreport parameter "TaxYear". When I run this report for 2024, as above, I do not see the NoRowsMessage like I do when I run the report on its own.
Reviewing your response, I have a few questions. What do you mean add a "year dataset to each report"? In your case, your dataset is using the filter panel, whereas mine is using a parameter, which is what you recommend a couple steps later ("carry the parameters of the subreport in the query, not in the filter panel"). My underlying SQL query is simply stating alias.year = :TaxYear, which differs slightly from what you have using an in operator.
When I remove the message from NoRowsMessage, I still get a "result", but it is empty. Again, this is when running the subreport on its own.
However, running the main report, again, I do not see an empty table - I see nothing at all, just blank space.
What I am expecting is that I can set NoRowsMessage in the tablix of my subreport, and if I get no rows returned from the query, I see my message both in the subreport itself and in the main report referencing the subreport.
- Anonymous1 year agoNot applicable
Hi, jdc136
Thank you very much for your reply. Here are the full demo processes, you can try to follow them:
For the Sub1 report I set it up as follows:
For the Sub2 report I set it up as follows:
For the main report, I set the following:
It delivers the results you're looking for:
In order to be able to get multiple choices, I use the IN keyword in my query here. Also add a dataset Year to the main report:
Modify the year parameter of the main report as follows:
Here are the results:
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- jdc1361 year agoRegular Visitor
Thank you for the detailed response Anonymous. I was able to get the NoRowsMessage to appear when there are multiple subreports. Appreciate it!