none
Update default values of parameter in a deployed SSRS report through VBS

    Question

  • 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

     

    Friday, May 27, 2011 2:16 AM

Answers

  • 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.
    Wednesday, June 01, 2011 5:12 AM
    Moderator