How to Generate the Report with help ReportViewer on the Server 2008 ?

  • Thread starter Thread starter Alexandra Grenader
  • Start date Start date
A

Alexandra Grenader

Guest
Hello, I use the asp.net MVC technology for the development.

I need to create the report with help ReportViewer. I used the Class Library and created the instance of the ReportViewer in Class Library.

I did all the definitions of the Report and succeeded to create pdf file with help the code :

byte[] streamBytes =null;

stringreportPath ="c:\\TestReport.pdf";



ReportViewer reportViewer1 =newMicrosoft.Reporting.WinForms.ReportViewer();

streamBytes = rv.LocalReport.Render("PDF");


using(FileStreamstream = System.IO.File.OpenWrite(reportPath))


{ stream.Write(streamBytes, 0, streamBytes.Length);

stream.Flush();

stream.Close();

}


It was the Local Processing Mode.

And I created the pdf report without problems on my development computer (Windows 7)

with VS 2012. But After installing of my asp.net mvc application on Windows Server 2008

I got the the error :


An error occurred during local report processing./n at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()

at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)

at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)

at Microsoft.Reporting.WinForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)

at ReportsLibrary.RunCallsDetailsReport.CreatePdfReport().



  • My question is : If I need to create the report on the server(in the Controller) what Processing Mode I need to use ? is it possible to run my sample and create pdf Report ?

Or I need to change my code to Remote Processing and use the Reporting Services of Sql Server to generate reports ?

What about WCF ?

can I create the report with Report Viewer in WCF Service ?

Continue reading...
 
Back
Top