本文介绍了建议在代码中更正以呈现报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我被建议使用以下代码以PDF格式以编程方式呈现SSRS报告。

我尝试了但它无效。



任何人都可以建议可能需要什么吗?

谢谢



Hi,
I was suggested the following code to programmatically render SSRS report in PDF format.
I tried it but it is not working.

Can any body suggest what might be required?
Thanks

Dim format As String = "PDF"
        Dim fileName As String = "C:\Output.pdf"
         Dim reportPath As String = "/[Report Folder]/Invoice"

        ' Prepare Render arguments
        Dim historyID As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim extension As String = Nothing
        Dim encoding As String
        Dim mimeType As String = "application/pdf"
        Dim warnings() As Microsoft.Reporting.WinForms.Warning = Nothing
        Dim streamIDs() As String = Nothing
        Dim results() As Byte

        ReportViewer1.LocalReport.Render(format, deviceInfo, mimeType, encoding, fileName, streamIDs, warnings)

      
        ' Open a file stream and write out the report
        Dim stream As FileStream = File.OpenWrite(fileName)
        stream.Write(results, 0, results.Length)
        stream.Close()
解决方案

这篇关于建议在代码中更正以呈现报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:08