TheDirtyJenks
TheDirtyJenks

Reputation: 449

SSRS 2008 R2 Subreport that returns no data will not display

Used this site for many years but first time posting a question...

I have a parent report which consists of multiple child sub-reports (all being the same report for testing purposes). The child reports contain a tablix and a few free-standing textboxes that act as a header/title (but are in the body).

The issue I am having is when any of the child reports return no data (null), none of that child's report (tablix or textboxes) gets rendered in the parent report. I would like to have the textboxes from the child be rendered in the parent no matter what.

I am a little confused because I thought the default behavior would have been to display everything from the child report but without any entries within the tablix (or at the very least display the textboxes).

Now for what I have tested:

-If there is data coming from the sub-reports query, there is no problem and everything displays correctly.

-Adding a NoRowsMessage will display but with nothing else from the sub-report (specifically looking for the textboxes)

-When running the parent report with ALL of the child reports returning no data, the child reports that can fit on the first page will display correctly, but when viewing the following pages, they will all be blank (unless the NoRowsMessage is set). Also, when moving away from that first page and attempting to come back to it will result in it becoming blank like the others.

-Thought maybe some small setting got changed that I was missing and decided to recreate the parent report which did not fix the issue.

Notes:

-The sub-report has no margins and standard letter size, while the parent also has standard letter size and .5 in margins on all sides except for the left which has a 1 in margin (don't think any of this is the issue).

-Sub-report consists of 2 parameters, one internal dataset while the other is a shared dataset.

-On re-creation, I only changed the page break settings and it still would not show correctly.

-Sub-reports run fine independently

I spent all day playing with the report and have not been able to find the problem and thought maybe someone else with a lot more experience would be able to advise. Found a lot of questions on how to hide these sub-reports without data coming in, but not showing it.

Any guidance to the dilemma or how a sub-report does not render without changing any default settings would be greatly appreciated! Any follow up questions are encouraged. Thanks!

Upvotes: 5

Views: 4198

Answers (1)

TheDirtyJenks
TheDirtyJenks

Reputation: 449

In case others stumble across this problem, a fix was to create a new dataset that returned an empty string (i.e. Select ''). Add a texbox and have it populated by that 'dummy' dataset. This forces the subreport to always return data from a dataset (even if its just an empty string) and therefore will always be displayed in the parent report

Upvotes: 8

Related Questions