meqrng
Last Updated: February 25, 2016
·
8.792K
· petermorlion

Forcing a SSRS subreport to show

In SSRS, when the dataset of a subreport contains no data, the subreport won't show in your main report. You can use the NoRows property of in the main report to show a message, but maybe you want the controls of your subreport to be visible (the table headers,...)

The following hack can achieve this:

Add a new DataSet to your subreport

Choose a DataSource (even though we won't use it) and set the following as query:

SELECT ' ' AS DUMMY

Or for Oracle (PL/SQL):

SELECT ' ' AS DUMMY FROM DUAL

Now add a Textbox to your subreport and set its value to:

=First(Fields!DUMMY.Value, "DataSetToForceSubreportVisibility")

Leave the textbox as visible or it won't work (at least, it didn't for me). That's why I took an empty string and not a number (i.e. SELECT 1).

Now, even when your main DataSet doesn't have data, your subreport will have data and so your subreport will always be visible.

Say Thanks
Respond

2 Responses
Add your response

9738
0 ocf8shwlm4fh9 ieoba0se2kvzhiq5ceh6r0sew2eopri3voqk0uio0guveqbc qitdycdzfndpm

Thank you =, This saved me a ton of wailing and gnashing of teeth.

over 1 year ago ·
9740

Glad to help!

over 1 year ago ·