简体   繁体   中英

Rendering and saving SSRS report in PDF

I need to save SSRS report in PDF programmatically (vb.net). I know when the report is rendered, we can save it in PDF from the triangle next to Disk icon, but I do not need to press this, rather save it using vb.net code.

Please advise. Thanks 在此处输入图片说明

This should help:

If reportViewer.ServerReport.IsReadyForRendering Then
    Dim fileData As Byte() = reportViewer.ServerReport.Render("PDF")
    System.IO.File.WriteAllBytes("C:\Path\filename.pdf", fileData)
Else
    'report parameters are not properly set, warn user to check
End If

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM