We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add Subreport with Stream

Thread ID:





142871 Feb 23,2019 03:46 PM UTC Feb 27,2019 05:56 AM UTC WPF 5
Tags: ReportViewer
Asked On February 23, 2019 03:46 PM UTC

I'm trying to add a Subreport dynamically via a Stream.

I've tryed to call the method LoadSubreport directly after the LoadReport Method.
But it's not working. Every time I get this error message: "An error occurred while rendering 'SubReport' report item."

If I render the SubReport as a normal report it works.

In the path-field of the subreport control I've set the same text i pass through the LoadSubReport method

What am I doing wrong?
Can you please provide me with an example project?


Mageshyadav M [Syncfusion]
Replied On February 25, 2019 10:21 AM UTC

Hi Stefan, 
We have validated the mention query with your shared details at our end. Please find the following code snippet to load subreport from stream, 
private void MainWindow_Loaded(object sender, RoutedEventArgs e) 
    viewer.ProcessingMode = ProcessingMode.Local; 
    Assembly assembly = typeof(MainWindow).GetTypeInfo().Assembly; 
    Stream reportStream = assembly.GetManifestResourceStream("ReportViewer.Reports.MainReport.rdlc"); 
    Stream subReportStream = assembly.GetManifestResourceStream("ReportViewer.Reports.SubReport.rdlc"); 
    viewer.SubreportProcessing += Viewer_SubreportProcessing; 
    viewer.LoadSubreport("SubReport", subReportStream); 
    viewer.DataSources.Add(new Syncfusion.Windows.Reports.ReportDataSource("TopSalesPerson", SalesPersons.GetTopSalesPerson()));    
private void Viewer_SubreportProcessing(object sender, Syncfusion.Windows.Reports.SubreportProcessingEventArgs e) 
    e.DataSources.Add(new Syncfusion.Windows.Reports.ReportDataSource("StoreSales", StoreSales.GetData())); 
We have created standalone sample to load subreport from the stream and it can be downloaded from the following location,    

Replied On February 25, 2019 06:04 PM UTC


Thanks a lot.

Mageshyadav M [Syncfusion]
Replied On February 26, 2019 12:29 PM UTC

Hi Stefan, 
Thanks for your update. 
We hope provided solution would have helped on your side. 

Replied On February 26, 2019 05:47 PM UTC

Hi again,
yeah thank you very much.

It helped a lot.

Padmini Ramamurthy [Syncfusion]
Replied On February 27, 2019 05:56 AM UTC

Hi Stefan, 
You are welcome and please get back to us at anytime if you need any other assistance. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon