Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

rs.exe and open saved PDF file

$
0
0

Hi,

there is a working code similar to below, which render and save report to PDF. Is it possible to open it directly in PDF Viewer or Browser with or without saving?

Thanks in advance for your help.

Dim format as string = "PDF"
Dim fileName as String = "C:\test.pdf"
Dim reportPath as String = "/reportTest"

Public Sub Main()

    ' Prepare Render arguments
    Dim historyID as string = Nothing
    Dim deviceInfo as string = Nothing
    Dim showHide as string = Nothing
    Dim results() as Byte
    Dim encoding as string
    Dim mimeType as string = "application/pdf"
    Dim warnings() AS Warning = Nothing
    Dim reportHistoryParameters() As ParameterValue = Nothing
    Dim streamIDs() as string = Nothing
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials

    Dim parameters(1) As ParameterValue
    parameters(0) = New ParameterValue()
    parameters(0).Name = "Employee"
    parameters(0).Value = " "
     parameters(1) = New ParameterValue()
    parameters(1).Name = "WeekNumber"
    parameters(1).Value = WeekNumber
     results = rs.Render(reportPath, format, _
        Nothing, Nothing, parameters, _
        Nothing, Nothing, encoding, mimeType, _
        reportHistoryParameters, warnings, streamIDs)


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

End Sub


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>