SQL Server Performance

.rss file

Discussion in 'SQL Server 2005 Reporting Services' started by lcerni, Jul 22, 2010.

  1. lcerni New Member

    Reporting Services is absolutely new to me. I have been requested to followed the steps in this blog "http://sqlblog.com/blogs/roman_reha...srs-report-rendering-from-command-prompt.aspx" to export the data to an excel spreadsheet from one report.
    This report (I guess this is the rdl file?) that I am using works due to a default parameter value that we have set @parameter. Basically the query behind this is SELECT * FROM TableName WHERE Parameter=@Parameter
    Is it possible to create another report service script (.rss) to execute the same ABC report but with the additional functionality to pass in different parameter values for the @parameter and save the results to Excel.
    For example, I want to run this rdl file with Query1 (SELECT * FROM TableName WHERE Parameter='X') and export it into an excel worksheet with Sheet1 labeled as X. Then I want to rerun this same rdl file with Query2 (SELECT * FROM TableName WHERE Parameter='Y') and export it into the same worksheet with Sheet2 labeled as Y.
    This is the .rss file that I have created. Is it possible to add the @parameter to it? This looks like VB to me and I really don't know VB.
    I think all I need is to alter the FileStream area but I have not been successful.
    Public Sub Main()
    Dim format as string = "EXCEL"
    Dim fileName as String = "C: emp
    eportsTest.xls"
    Dim reportPath as String = "/ReportTest/ABC"

    ' Prepare Render arguments
    Dim historyID as string = Nothing
    Dim deviceInfo as string = Nothing
    Dim extension as string = Nothing
    Dim encoding as string
    Dim mimeType as string
    Dim warnings() AS Warning = Nothing
    Dim streamIDs() as string = Nothing
    Dim results() as Byte

    rs.LoadReport(reportPath, historyID)
    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
  2. satya Moderator

    Did you look at the ASP.NET related forums for such information>

Share This Page