Rs.Render

  • I need to generate a PDF file from a command line.  I found this great article; http://www.sqljunkies.net/PrintContent.aspx?type=howto&id=B197B9E7-EF3D-4D70-9B5E-47B74E57EF38

    The problem I'm having is that when I go to execute it I get an error stating: Error BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005.ReportingService2005'.

    results = rs.Render(ReportPath, format, _

     

    Can anyone help?  Any advice would be greatly appreciated, thanks! 

     

  • This was removed by the editor as SPAM

  • The rs.exe with SQL 2005 will use ReportService2005endpoint as default. To use old endpoint , you have to use -e  option available with rs exe. Add -e mgmt2000 to the command line .  for more info use  rs.exe /? or in the MSDN help files.

    Problem persists

    drop a mail at shyjumohan@gmail.com

  • Have you find an equivalent to render method for 2005 end point?

    Thanks

  • This is great if you have a parameter with only one value but how does one pass in many values for a single parameter?

    This worked for me, save this file as RunReport.rss and save as UTF-8.

    'Dim format as string = "Excel"

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

    Dim format as string = "PDF"

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

    Dim reportPath as String = "/User Reports/User Details 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 = "ms-excel"

    'Dim extension as string = "xls"

    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(1) As ParameterValue

    parameters(0) = New ParameterValue()

    parameters(0).Name = "CombinedName"

    parameters(0).Value = "Shi Ray"

    parameters(1) = New ParameterValue()

    parameters(1).Name = "CombPriv"

    parameters(1).Value = "Users - Per1"

    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

    Then run as:

    rs -i RunReport.rss -s http://localhost/reportserver$SQLExpress -e Exec2005

    Here are the references:

    http://www.sqljunkies.ddj.com/Article/B197B9E7-EF3D-4D70-9B5E-47B74E57EF38.scuk

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=242968&SiteID=1

  • Thanks guys, script worked perfectly.

Viewing 6 posts - 1 through 5 (of 5 total)

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