Francis Bastin

Francis Bastin

  • NA
  • 166
  • 1.4k

Return ReportViewer from wcf service

May 17 2018 4:48 AM
Hi,
 
I want return report viewer as an out variable from wcf service to client application.
 
because I am using SSRS report and report authentication should be taken where the wcf
service was installed. After fetch data in wcf I want to return a result to client application and display in report viewer.
 
Below are the code in wcf service but not working:
  1. public ReportViewer GetReportSSRS(CustomDataReport customeReport, string _outputIDs, string reportName)  
  2. {  
  3. ReportViewer report = new ReportViewer();  
  4. report.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;  
  5. report.ServerReport.ReportServerUrl = new Uri("http://Testserver/ReportServer");  
  6. Microsoft.Reporting.WinForms.ReportParameter _from = new Microsoft.Reporting.WinForms.ReportParameter("Start", customeReport.Start.ToString());  
  7. Microsoft.Reporting.WinForms.ReportParameter _to = new Microsoft.Reporting.WinForms.ReportParameter("Finish", customeReport.Finish.ToString());  
  8. Microsoft.Reporting.WinForms.ReportParameter _OutputId = new Microsoft.Reporting.WinForms.ReportParameter("OutputValue", _outputIDs);  
  9. Microsoft.Reporting.WinForms.ReportParameter _name = new Microsoft.Reporting.WinForms.ReportParameter("Name", customeReport.Name);  
  10. Microsoft.Reporting.WinForms.ReportParameter _dataGroup = new Microsoft.Reporting.WinForms.ReportParameter("DataGroupName", customeReport.DataGroup.Name);  
  11. Microsoft.Reporting.WinForms.ReportParameter _displayTotal = new Microsoft.Reporting.WinForms.ReportParameter("DisplayTotal", customeReport.DisplayTotal.ToString());  
  12. eport.ServerReport.ReportPath = "/Report/CustomDataReport";  
  13. Microsoft.Reporting.WinForms.ReportParameter _Logo = new Microsoft.Reporting.WinForms.ReportParameter("LogoPath""Logo.jpg");  
  14. report.ServerReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter[] { _from, _to, _OutputId, _name, _dataGroup, _displayTotal, _Logo });  
  15. report.ShowParameterPrompts = false;  
  16. report.ServerReport.DisplayName = reportName;  
  17. return report;  
  18. }