January 8, 2013 at 7:33 pm
Hi,
I've got a report I need to run many times for different date parameter.
I run the report using the script below with rs utility:
rs -i c:\temp\Report_251212.rss -s http://localhost/reportserver -e Exec2005
Would it be possible to pass the data parameter from rs utility, e.g.:
rs -i c:\temp\Report.rss -s http://localhost/reportserver -e Exec2005 Date = '12/25/12'
rs -i c:\temp\Report.rss -s http://localhost/reportserver -e Exec2005 Date = '12/26/12'
rs -i c:\temp\Report.rss -s http://localhost/reportserver -e Exec2005 Date = '12/27/12'
Thanks.
Dim format as string = "PDF"
Dim fileName as String = "C:\temp\Report_251212.pdf"
Dim reportPath as String = "/Basic Stats/Report"
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 = Nothing
Dim mimeType as string = "application/pdf"
Dim extension as string = "pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim parameters(2) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "WebsitePrimaryID"
parameters(0).Value = "1"
parameters(1) = New ParameterValue()
parameters(1).Name = "Date"
parameters(1).Value = "12/25/2012"
parameters(2) = New ParameterValue()
parameters(2).Name = "WithPageViews"
parameters(2).Value = "True"
Dim execHeader AS New ExecutionHeader()
Dim rpt AS New ExecutionInfo
rpt = rs.LoadReport(reportPath, Nothing)
rs.SetExecutionParameters(parameters, "en-us")
rs.ExecutionHeaderValue = execHeader
rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID
results = rs.Render(format, deviceInfo, extension, mimeType, encoding, 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 post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy