rs.exe report automation help

  • I've got an issue I'm hoping I might be able to get some input on

    here.

    In this instance I am using MS SQL 2000 and Reporting Services 2000.

    I need to automate the output of several parameterized reports, and

    I'm not quite sure what the best method is to do this. My initial

    searches seemed to point to rs.exe, but I could not get that to work

    for me and not sure why. When I try my command as follows:

    rs -i c:\RunReport.rss -s http://server1.domainname.com/reportserver -

    v parameter1="My Report" -t

    I get "Could not connect to server". The full text of the error is as

    follows:

    System.Exception: Could not connect to server: http://

    server1.domainname.com/reportserver/ReportService.asmx

    at

    Microsoft.ReportingServices.ScriptHost.ScriptHost.DetermineServerUrlSecurity()

    at Microsoft.ReportingServices.ScriptHost.ScriptHost.InstanceMain()

    at Microsoft.ReportingServices.BaseCmdLine.CommandLineMain(String[]

    args, BaseCmdLine instance)

    Can someone tell me what this means and if there might be something I

    am doing wrong? Or if this won't work for me, what other methods can

    I use to automate reports from RS 2000?

    Any insight or help is greatly appreciated.

    Woody.

  • This was removed by the editor as SPAM

  • Well, I've sort of determined part of the problem, and in turn, part of a solution, but I'm still running into a block.

    My problem was that our product uses Forms Authentication, and therefore MS RS 200 is also setup to use this authentication. rs.exe does NOT work with forms authentication.

    So what I've done is installed a new instance of RS2000 on a new machine, and in-turn have also created the DataSource and imported the .RDL into my new instance of RS2000.

    I've created an RSS file with the parameters to send to this report, but I get an error as follows:

    "The value of parameter 'Parameters' is not valid. Check the documentation for information about valid values."

    Here is my RSS file, used to pass the parameters to my report:

    *********************************************************

    ' File: RunReport.rss

    Dim format as string = "Excel"

    Dim fileName as String = "C:\Export2.xls"

    Dim reportPath as String = "/APSAgentCourseCompletionByUserGroup"

    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 = "ms-excel"

    Dim warnings() AS Warning = Nothing

    Dim reportHistoryParameters() As ParameterValue = Nothing

    Dim streamIDs() as string = Nothing

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials

    ' Report Parameters

    Dim parameters(5) As ParameterValue

    parameters(0) = New ParameterValue()

    parameters(0).Name = "User Group"

    parameters(0).Value = UserGroup

    parameters(1) = New ParameterValue()

    parameters(1).Name = "Start Date"

    parameters(1).Value = StartDate

    parameters(2) = New ParameterValue()

    parameters(2).Name = "End Date"

    parameters(2).Value = EndDate

    parameters(3) = New ParameterValue()

    parameters(3).Name = "Course Name"

    parameters(3).Value = CourseName

    parameters(4) = New ParameterValue()

    parameters(4).Name = "Status To Include"

    parameters(4).Value = StatusToInclude

    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

    'End of script

    *********************************************************

    Any suggestions on what I may be doing wrong?

    Any ideas are appreciated.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply