1 Reply Latest reply: Jun 10, 2012 7:31 AM by Jason Lax RSS

subreport linking issue

Charles Henning
Currently Being Moderated

I am using Visual Studio 2010. I have a main report with 3 subreports. Each has a separate data source but there is an ID field that is common to all.

 

In some cases the ID field will be null in the main report and so there will be no data in the subreport. This works fine if at least 1 record in the main report has a valid ID and each of the subreports has at least 1 record with the same ID. In that case all data renders properly in the main report and all subreports. Even items that have the null ID in the main report render the rest of the fields properly.

 

If, however, all records in the main report's data source have a null ID then the user is prompted for 3 parameters before the report will render.

If there is at least 1 valid ID in the main report and there are records in subreport 1 that match that ID then the user is prompted for 2 parameters which are for the other 2 subreports that have no data to link up.

 

The subreports are linked by right-clicking them in the main report and selecting the ID field as the Field to lint to. This automatically creats a parameter field in the subreport. The check in "Select data in subreport based on field:" is also checked and the "SubreportName.ID" is selected in that dropdown.

 

Why does the data in the main report render properly even when the subreports are blank but only if at least 1 record in the main report has subreport data?

 

Is there a way to indicate that the main report should always render even if the subreports are blank and not ask for subreport parameters?

Actions