.NET Framework - Nesting multiple layers of SubReporting (ReportViewer Control)

Asked By dnv2 on 07-Sep-07 06:04 AM
In ReportViewer we encountered a problem trying to recursively call a
subreport so that a deeply nested data structure can report to the level it
needs to using nested Business objects. (e.g. something like a family tree
structure where the number of descendents are not know in advance and where
the descendent is the same type of business object as the parent). The
requirement is not to chart the structure grapically but instead to supply a
report where the detail of each object is reported within the context of its
structure.

We have been trying to acheive this but do not see how it is possible to set
the SubreportProcessingEventHandler of the rdlc file which is subreport of
the LocalReport.

Best regards

Marek




v-lli replied on 10-Sep-07 05:14 AM
Hi Marek,

Sorry that I may not understand your scenario and question exactly.

subreport so that a deeply nested data structure can report to the level it
needs to using nested Business objects.

What do you mean by "recursively call a subreport"? If possible, could you
please send me a simple project that could explain what you want?

To get my actual email address, remove 'online' from my displayed email
address.

Thank you for your cooperation and I look forward to your reply!

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
v-lli replied on 11-Sep-07 03:23 AM
Hi Marek,

Thank you for your sample project and detailed explanation! I can
understand your question now.

When I run the sample application, I see the ROReport and ROChild reports
are displayed properly. However, the ROGrandChild report isn't shown,
instead, I see an error text "Error: Subreport could not be shown".

I make the following modifications on your sample project and all the three
reports could be displayed correctly on my side:

1.	Open the ROGrandChild.rdlc in the designer and set the 'Copy to Output
Directory' property to 'Copy if newer' in the Properties window.
2.	Open the ROChild.rdlc in the designer. Right click the subreport on the
ROChild report and choose Properties. In the Subreport Properties window,
switch to Parameters tab and add a parameter in the list. The parameter
name is 'ROID' and the parameter value is '=Fields!Key.Value'.

Please try this on your side to see if it solves the problem and let me
know the result.

If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support