views:

299

answers:

2

hi i do have a report which has 3 subreports. if in case of no data i need to hide the report now its giving the error Error: Subreport could not be shown how can i hide the subreports.

+1  A: 

You are going to have to create some mechanism of knowing whether or not a subreport will successfully be shown on the main report because you aren't going to be able to "return" anything back to the main report from the subreport.

Could you create a small dataset on your main report that would query to check if data will exists for the subreport? and then you could use an expression on the subreport element (or container such as tablix or rectangle) to hide it based upon the results of the query on the main report.

Let me know if I need to clarify.

Jon Erickson
A: 

Hi boss. if we directly create a dataset in the main report itself then there is no question of using another report as a subreport we can directly use the fields from the data set created in the main report and assigning parameters to main dataset values. i think that will not server purpose.

abhi