i need to render some reports from ssrs everything looks quite easy using the web service there is only one BIG problem
i need to render some reports from ssrs
everything looks quite easy using the web service
there is only one BIG problem
I need to pass a null string (null in c#, nothing in vb.net) to the method LoadReport as HistoryID
nothing else works, alternative is a valid datetime string but then ssrs looks for the snapshot report with that date and time
today i have tried whatever, but $null is passing an empty string what is not valid, any other thing does not seem to work neither
code:
$rs = New-WebServiceProxy -uri
http://localhost/reportserver_geman/reportexecution2005.asmx?WSDL
-UseDefaultCredential #v2 cmdlet
$rs.LoadReport("/HMCReports/PostCodesEnPlaatsen", $null)
Generates the error:
Exception calling "LoadReport" with "2" argument(s): "System.Web.Services.Protocols.SoapException: The parameter value provided for 'snapshotID' does not match the parameter type. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ParameterTypeMismatchException: The parameter value provided for 'snapshotID' does not match the parameter type. ---> System.FormatException: String was not recognized as a valid DateTime. at Microsoft.ReportingServices.WebServer.ReportExecution2005Impl.LoadReport(String Report, String HistoryID, ExecutionInfo2& executionInfo) at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)"
Exception calling "LoadReport" with "2" argument(s): "System.Web.Services.Protocols.SoapException: The parameter value provided for 'snapshotID' does not match the parameter type. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ParameterTypeMismatchException: The parameter value provided for 'snapshotID' does not match the parameter type. ---> System.FormatException: String was not recognized as a valid DateTime.
at Microsoft.ReportingServices.WebServer.ReportExecution2005Impl.LoadReport(String Report, String HistoryID, ExecutionInfo2& executionInfo)
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)"
In C#:, this works:
string historyID = null;
execInfo = rs.LoadReport(reportPath, historyID);
and this generates the same error:
string historyID = "";
The problem is this, essentially:
PS C:\Users\david> ([string]$null).gettype() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object
I can't think of a way around it in PowerShell. Maybe you should file a bug.