Ok, so i am working on exporting my SSRS 2008 Reports to an image. What I would like to do is Export each individual page as an image. From my code, I can only get it to export the first page of the report. Any help would greatly be appreciated.
Dim warnings As Microsoft.Reporting.WebForms.Warning()
Dim streamids As String()
Dim mimeType, encoding, extension As String
Dim deviceInfo As XElement = _
<DeviceInfo>
<OutputFormat>JPEG</OutputFormat>
</DeviceInfo>
Report.ServerReport.SetParameters(Parameters)
Dim bytes As Byte() = Report.ServerReport.Render("Image", deviceInfo.ToString(), mimeType, encoding, extension, streamids, warnings)
Dim FileStream As New MemoryStream(bytes)
Dim ReportImage As New System.Drawing.Bitmap(FileStream)
ReportImage.Save(Server.MapPath("/Testing.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg)
in one of my projects I use the following code to obtain one stream per page. Unfortunately I don’t use VB.NET, but you should be able to translate this from C# to VB. Note: This works on SSRS2005 – I’m not sure it also works for SSRS2008! Also, I’m using the code to directly print the report without having to use the report viewer, so I’m creating an EMF device info – you might have to change this.
This base code was found somewhere on the Web after Googling for hours – I’d like to credit the author, but I didn’t bookmark the link – sorry.
EDIT
Forgot to mention that
vieweris a programmatically created instance of theReportViewercontrol initialized to render the report that you’re trying to print/save.