Friday, March 23, 2012

RS2005 Testing

I've creating a bunch of straight-forward and useful reports. Everybody that
sees them loves them.
The problem is that now they want to deploy these reports to production. My
testing has been to run them a few times and look at the results.
Most of these reports take a couple of ints as input parameters, and print
out a table with some date and page info in the header and footer. The data
query is simple t-sql in a stored procedure.
Any thoughts or pointers on how to automate testing for simple RS2005
Reporting Services reports?
Thanks,
--
RandyHello Randy,
I would like to make this issue more clear.
What do you mean to automate test the RS 2005 report?
Do you want to use a program to test whether the reports on the Report
server is working fine?
If so, you could use the Reporing services web service to render the report
on the server and test whether they are working fine.
Please let me know the detailed information of your automate testing. Thank
you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||I'm wondering if there's a way to programmatically read values from a table
in a Reporting Services report?
Seems like my alternative is to simply read the results of the stored
procedure that provides data to the report, and test the results against
known values. My problem with that is I'm only testing the stored procedure,
not the report at all.
If I could programmatically read from the report and compare values for a
given set of input parameters, I'm testing the stored procedure and the
report.
--
Randy
"Wei Lu [MSFT]" wrote:
> Hello Randy,
> I would like to make this issue more clear.
> What do you mean to automate test the RS 2005 report?
> Do you want to use a program to test whether the reports on the Report
> server is working fine?
> If so, you could use the Reporing services web service to render the report
> on the server and test whether they are working fine.
> Please let me know the detailed information of your automate testing. Thank
> you!
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello Randy,
Are the input parameters all the report parameters? If so, you could use
the Report Services Web Services to execute the report with given
parameters.
For more information, please refer the Reporting Services Web Services
Class Library
http://msdn2.microsoft.com/en-us/library/ms159717.aspx
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Using Reporting Services Web Service to execute the report sounds great! Any
suggestions on how to read the data in the report, to compare it to expected
values?
Thanks,
--
Randy
"Wei Lu [MSFT]" wrote:
> Hello Randy,
> Are the input parameters all the report parameters? If so, you could use
> the Report Services Web Services to execute the report with given
> parameters.
> For more information, please refer the Reporting Services Web Services
> Class Library
> http://msdn2.microsoft.com/en-us/library/ms159717.aspx
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||We have reports with about 4 nested parameters. We created a test app that
uses the soap api to query the report parameters and builds an array with
all possible parameter combinations. We then run these reports, we render
them to pdf format and use pdfbox to prepend a page count to the file name.
We also script out the parameters so we don't have to go through the
overhead of calculating all the combinations for subsequent testing runs.
We output error messages that capture parameter combinations that result in
reports that won't run. We spot check data, the page number thing helps us
with finding matrix controls that spill over to two page widths. We also
open the files and look for text overlap, that kind of thing. We were also
outputing to...? I think text...or something like that and searching for
'Error', but I haven't been doing that lately.
example RunReports.rss:
Dim ParentrentPath As String = "/" + ReportDir
Public Sub Main()
RunReport("foo", "c:\temp\reports\9~5~2006 5~54~41
PM\foo\pdf\foo__38.pdf", "fooID", "38")
RunReport("foo", "c:\temp\reports\9~5~2006 5~54~41
PM\foo\pdf\foo__857.pdf", "fooID", "857")
End Sub
Public Sub RunReport(ByVal reportName As String, ByVal ParamNames As String,
ByVal ParamValues As String)
Dim objReportResult As Byte()
Dim encoding As String
Dim mimeType As String
Dim rptParamsUsed As ParameterValue()
Dim warnings As Warning()
Dim streamIDs As String()
Dim fs As FileStream
Dim Names As String()
Dim Values As String()
Dim rptParamValues As ParameterValue()
Dim Counter As Integer
If ParamNames Is Nothing Then
rptParamValues = Nothing
Else
Names = ParamNames.Split(", ")
Values = ParamValues.Split(", ")
ReDim rptParamValues(Names.Length - 1)
For Counter = 0 To Names.Length - 1
rptParamValues(Counter) = New ParameterValue()
rptParamValues(Counter).Name = Names(Counter)
rptParamValues(Counter).Value = Values(Counter)
Counter = Counter + 1
Next Counter
End If
Try
objReportResult = rs.Render(ParentPath + "/" + reportName, "PDF",
Nothing, Nothing, rptParamValues, Nothing, Nothing, encoding, mimeType,
rptParamsUsed, warnings, streamIDs)
fs = new FileStream("C:\temp\" + reportName + ".pdf",
FileMode.OpenOrCreate)
fs.Write(objReportResult, 0, objReportResult.Length)
fs.Close()
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
RunReports.cmd
@.echo off
REM ==============================================REM SET Variables
REM ==============================================set rscmd=rs.exe
set rssfile=.\RunReports.rss
set rspath=\Program Files\Microsoft SQL Server\90\Tools\Binn\
set rssubdir=%6
set rssparams=-i %rssfile% -s %1 -v filePath=".\\" -v
ReportDir=%rssubdir% -v RSDBServer=%2 -v DataDB=%3 -v DataDBUser=%4 -v
DataDBPwd="%5" -v RSDSName=%7
%rscmd% %rssparams%
Then we use wrapper command files for the different environment...dev, qa
REM --Parameters--
REM 1: RS server
REM 2: datasource db server
REM 3: datasource db name
REM 4: datasource db login
REM 5: datasource db password
REM 6: rs folder
REM 7: rs datasource name
RunReports.cmd blah, blah, blah
Steve MunLeeuw
"randy1200" <randy1200@.newsgroups.nospam> wrote in message
news:6FA66166-9C18-4A51-A6FB-34F0746F3AF6@.microsoft.com...
> I've creating a bunch of straight-forward and useful reports. Everybody
> that
> sees them loves them.
> The problem is that now they want to deploy these reports to production.
> My
> testing has been to run them a few times and look at the results.
> Most of these reports take a couple of ints as input parameters, and print
> out a table with some date and page info in the header and footer. The
> data
> query is simple t-sql in a stored procedure.
> Any thoughts or pointers on how to automate testing for simple RS2005
> Reporting Services reports?
> Thanks,
> --
> Randy|||Hi Randy,
I think you could render to the CSV format so that you could read the text
content of the report and compare the result to the expected one.
Have you tried the solution that Steve MunLeeuw provided? His suggestion
sounds great.
Sincerely,
Wei Lu
Microsoft Online Community Support|||Hello Randy,
I would like to know the status of this issue. If you have any questions,
please feel free to let me know.
Sincerely,
Wei Lu
Microsoft Online Community Support|||Hi Steve,
I too am attempting to render reports using the "rs" utility with the
following code;
=== Begin code===== Public Sub Main()
' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = "/Financial Reports/Flash/Flash Report"
Dim format As String = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo As String =
"<DeviceInfo><OmitDocumentMap>false</OmitDocumentMap><OmitFormulas>false</OmitFormulas><RemoveSpace>0.125in</RemoveSpace><SimplePageHeaders>false</SimplePage
Headers></DeviceInfo>"
' Prepare report parameter.
Dim rptParamsUsed As ParameterValue
Dim parameters(4) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "CalendarsCalendars"
parameters(0).Value = "[Calendars].[Calendars].[Week
Number].&[200615]"
parameters(1) = New ParameterValue()
parameters(1).Name = "ProfitCenterRollupsProfitCenterRollups"
parameters(1).Value = "[Profit Center Rollups].[Profit Center
Rollups].[Enterprise].&[CIBER Departments].[Custom Solutions
Consolidated].[East
Region].[Atlanta]"
parameters(2) = New ParameterValue()
parameters(2).Name = "BookedDatesBookedDates"
parameters(2).Value = "[Booked Dates].[Booked Dates].[All Booked
Dates]"
parameters(3) = New ParameterValue()
parameters(3).Name = "CurrenciesCurrencies"
parameters(3).Value ="[Currencies].[Currencies].[Country].&[USA].&[US Dollar]"
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String = ""
Dim mimeType As String = ""
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim extension As String = ""
Try
result = rs.Render(format, devInfo , extension, encoding,
mimeType, warnings, streamIDs)
Catch e As SoapException
Console.WriteLine(e.Detail.OuterXml)
End Try
Try
Dim stream As FileStream
stream = new FileStream("report.xls", FileMode.OpenOrCreate)
Console.WriteLine("File created.")
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to the file.")
stream.Close()
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub 'Main
===End code===On executing this from the command line with the following command:
rs -i a1.rss -s http://cdc-dwwebd1/reportserver_dev -e Exec2005
I get the the following error:
===Error mesage (start)====C:\Documents and Settings\AGopalan\My Documents\Junk>rs -i a1.rss -s
http://cdc-dwwebd1/reportserver_dev -e Exec2005
<detail><ErrorCode
xmlns="rsMissingSessionId</ErrorCode><HttpStatus">http://www.microsoft.com/sql/reportingservices">rsMissingSessionId</ErrorCode><HttpStatus
xmlns="400</HttpStatus><Message">http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message
xmlns="The">http://www.microsoft.com/sql/reportingservices">The session identifier
is mis
sing. A session identifier is required for this operation.
</Message><HelpLink
xmlns="http:/">http://www.microsoft.com/sql/reportingservices">http:/
/go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsMissingSessionI
d&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.3159.00</HelpLink><ProductName xmlns="http://www.microsoft.c
om/sql/reportingservices">Microsoft SQL Server Reporting
Services</ProductName><ProductVersion
xmlns="http://www.microsoft.com/sql/reporting
services">9.00.3159.00</ProductVersion><ProductLocaleId
xmlns="127</ProductLocaleId><Operati">http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><Operati
ngSystem
xmlns="OsIndependent</OperatingSystem><CountryLocaleId">http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId xmlns="http://www.microsoft.
com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
xmlns="<Source>ReportingSe">http://www.microsoft.com/sql/reportingservices"><Source>ReportingSe
rvicesWebServer</Source><Message msrs:ErrorCode="rsMissingSessionId"
msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=
Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsMissingSessionId&ProdName=Microsoft%20SQL%20Server%20Reportin
g%20Services&ProdVer=9.00.3159.00"
xmlns:msrs="The">http://www.microsoft.com/sql/reportingservices">The session
identifier is missing. A sess
ion identifier is required for this operation.
</Message></MoreInformation><Warnings
xmlns="http://www.microsoft.com/sql/reportingservices"
/></detail>
File created.
Object reference not set to an instance of an object.
The command completed successfully
===Error mesage (end)====
I am at a loss at to what the error is. It seems to 'cry' about a missing
session id.
Any help is greatly appreciated.
--
ashok
"Steve MunLeeuw" wrote:
> We have reports with about 4 nested parameters. We created a test app that
> uses the soap api to query the report parameters and builds an array with
> all possible parameter combinations. We then run these reports, we render
> them to pdf format and use pdfbox to prepend a page count to the file name.
> We also script out the parameters so we don't have to go through the
> overhead of calculating all the combinations for subsequent testing runs.
> We output error messages that capture parameter combinations that result in
> reports that won't run. We spot check data, the page number thing helps us
> with finding matrix controls that spill over to two page widths. We also
> open the files and look for text overlap, that kind of thing. We were also
> outputing to...? I think text...or something like that and searching for
> 'Error', but I haven't been doing that lately.
> example RunReports.rss:
> Dim ParentrentPath As String = "/" + ReportDir
> Public Sub Main()
> RunReport("foo", "c:\temp\reports\9~5~2006 5~54~41
> PM\foo\pdf\foo__38.pdf", "fooID", "38")
> RunReport("foo", "c:\temp\reports\9~5~2006 5~54~41
> PM\foo\pdf\foo__857.pdf", "fooID", "857")
> End Sub
>
> Public Sub RunReport(ByVal reportName As String, ByVal ParamNames As String,
> ByVal ParamValues As String)
> Dim objReportResult As Byte()
> Dim encoding As String
> Dim mimeType As String
> Dim rptParamsUsed As ParameterValue()
> Dim warnings As Warning()
> Dim streamIDs As String()
> Dim fs As FileStream
> Dim Names As String()
> Dim Values As String()
> Dim rptParamValues As ParameterValue()
> Dim Counter As Integer
> If ParamNames Is Nothing Then
> rptParamValues = Nothing
> Else
> Names = ParamNames.Split(", ")
> Values = ParamValues.Split(", ")
> ReDim rptParamValues(Names.Length - 1)
> For Counter = 0 To Names.Length - 1
> rptParamValues(Counter) = New ParameterValue()
> rptParamValues(Counter).Name = Names(Counter)
> rptParamValues(Counter).Value = Values(Counter)
> Counter = Counter + 1
> Next Counter
> End If
>
>
> Try
> objReportResult = rs.Render(ParentPath + "/" + reportName, "PDF",
> Nothing, Nothing, rptParamValues, Nothing, Nothing, encoding, mimeType,
> rptParamsUsed, warnings, streamIDs)
> fs = new FileStream("C:\temp\" + reportName + ".pdf",
> FileMode.OpenOrCreate)
> fs.Write(objReportResult, 0, objReportResult.Length)
> fs.Close()
> Catch e As Exception
> Console.WriteLine(e.Message)
> End Try
> End Sub
> RunReports.cmd
> @.echo off
> REM ==============================================> REM SET Variables
> REM ==============================================> set rscmd=rs.exe
> set rssfile=.\RunReports.rss
> set rspath=\Program Files\Microsoft SQL Server\90\Tools\Binn\
> set rssubdir=%6
> set rssparams=-i %rssfile% -s %1 -v filePath=".\\" -v
> ReportDir=%rssubdir% -v RSDBServer=%2 -v DataDB=%3 -v DataDBUser=%4 -v
> DataDBPwd="%5" -v RSDSName=%7
> %rscmd% %rssparams%
>
> Then we use wrapper command files for the different environment...dev, qa
> REM --Parameters--
> REM 1: RS server
> REM 2: datasource db server
> REM 3: datasource db name
> REM 4: datasource db login
> REM 5: datasource db password
> REM 6: rs folder
> REM 7: rs datasource name
> RunReports.cmd blah, blah, blah
> Steve MunLeeuw
> "randy1200" <randy1200@.newsgroups.nospam> wrote in message
> news:6FA66166-9C18-4A51-A6FB-34F0746F3AF6@.microsoft.com...
> > I've creating a bunch of straight-forward and useful reports. Everybody
> > that
> > sees them loves them.
> >
> > The problem is that now they want to deploy these reports to production.
> > My
> > testing has been to run them a few times and look at the results.
> >
> > Most of these reports take a couple of ints as input parameters, and print
> > out a table with some date and page info in the header and footer. The
> > data
> > query is simple t-sql in a stored procedure.
> >
> > Any thoughts or pointers on how to automate testing for simple RS2005
> > Reporting Services reports?
> >
> > Thanks,
> > --
> > Randy
>
>

No comments:

Post a Comment