Update default values of parameter in a deployed SSRS report through VBS
Hi all,
I have a requirement like,
1. updating the report default parameters of a report in the report server through a VB Script.
2. Trigger that VBS through RS Utility.
is this possible??
Can any one suggest some code samples as i'm not familiar with VB Scripting.
Regards,
Sakthi
May 26th, 2011 10:19pm
Hi Sakthi,
It is possible. Based on your description, I created an example
UpdateParameter.rss below:
Public Sub Main()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim parameters As ReportParameter() = New ReportParameter(0) {}
parameters(0) = New ReportParameter()
Dim defaultValues As String() = New String(0){}
defaultValues(0)=defaultValue
parameters(0).Name = parameterName
parameters(0).DefaultValues=defaultValues
Try
rs.SetReportParameters(report, parameters)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
The rs utility uses the following syntax:
D:\>rs -i UpdateParameter.rss -s http://servername/ReportServer/foldername/reportname" -v parameterName="P1" -v defaultValue="xxx"
For more information about the SetReportParameters Method, please refer to
http://msdn.microsoft.com/en-us/library/reportservice2005.reportingservice2005.setreportparameters.aspx
About Scripting with the rs Utility and the Web Service, please refer to
http://msdn.microsoft.com/en-us/library/ms152874.aspx
Thanks,
Tony Chain
Tony Chain [MSFT CSG] | Microsoft Community Support
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 1:14am