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.
Unfortunately, activation email could not send to your email. Please try again.

ReportPath in other Assembly and Localization

Thread ID:

Created:

Updated:

Platform:

Replies:

124822 Jul 1,2016 07:45 AM Jul 4,2016 05:47 AM WPF 1
loading
Tags: ReportViewer
David García
Asked On July 1, 2016 07:45 AM

Hi,

I'm trying to configure the ReportPath property to load a RDLC report that is in another assembly. I have tried to use the full assembly name (ES.Trainfor.Example.Module.Report.ReportSample.rdlc) in the same way the ReportViewer control from Microsoft does but seems unable to find the report and always get the same error:
"The source of the report has not been specified"

I assign the ReportPath property and the ProcessingMode to Local.

Is there a specific way to set the ReportPath when the report file is in another assembly/project?

And another ReportViewer related question: what is the way to localize the control? There is no information in the documentation about how to do it for this control, or no resource file I could find for it.


Thanks in advance.

Vinoth Srinivasan [Syncfusion]
Replied On July 4, 2016 05:47 AM

  
Hi David, 
 
Thanks for contacting Syncfusion support. 
 
Query 
                                                                                         Response 
I'm trying to configure the ReportPath property to load a RDLC report that is in another assembly. I have tried to use the full assembly name (ES.Trainfor.Example.Module.Report.ReportSample.rdlc) in the same way the ReportViewer control from Microsoft does but seems unable to find the report and always get the same error: 
"The source of the report has not been specified"

I assign the ReportPath property and the ProcessingMode to Local.

Is there a specific way to set the ReportPath when the report file is in another assembly/project?
 
You can retrieve the report as resource stream and load it to ReportViewer using  LoadReport API as shown in the below code snippet. 
 
Assembly assembly = typeof(ReportAssembly.MainWindow).GetTypeInfo().Assembly; 
 
Stream stream = assembly.GetManifestResourceStream("ReportAssembly.ReportTemplate.Company Sales.rdlc"); 
 
Syncfusion.Windows.Reports.Viewer.ReportViewer viewer= mainWindow.FindName("viewer") as Syncfusion.Windows.Reports.Viewer.ReportViewer; 
 
viewer.DataSources.Add(new ReportDataSource("Sales", new ReportAssembly.AdventureWorks().GetDataTable())); 
 
viewer.LoadReport(stream); 
 
We have prepared a sample based on this and it can be downloaded from the below location. 
 
And another ReportViewer related question: what is the way to localize the control? There is no information in the documentation about how to do it for this control, or no resource file I could find for it. 
We have prepared a sample to localize the Report Viewer control using “es-ES” culture. It can be downloaded from the below location. 
 
 
 
Regards, 
Vinoth.S 
 


CONFIRMATION

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.

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.

;