title: snapshotID parameter type mismatch when calling Render method on ReportExecution2005.asmx SSRS service
body: <p>I am trying to render reports as PDF using the ReportExecution2005.asmx service endpoint on a SSRS 2012 server with MSSQL 2012 backend. When I call the Render method on the web service, I get the following error:
  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</p>
  
  <p>This error occurs with any report I try to render, snapshotID is not a parameter on the reports, and checking the configuration of the reports, they are not set up to be cached or use snapshots.  We just recently moved from MSSQL 2005 to 2012, using the ReportExecution2005 endpoint with SSRS and SQL 2005 I never saw this error, it worked fine.  I've tried adding snapshotID as a parameter with different values such as empty string, current time, etc. but that's apparently not what it's looking for.  Below is the code I'm using to set up and call the Render method on the service.  pstrExportFormat in my case will be "PDF"</p>
  
  <pre><code>   Public Function ExportReport(pstrReportPath As String, plstParams As List(Of ReportParameter), pstrExportFormat As String) As Byte()
    Dim lResults() As Byte = Nothing
    Dim lstrSessionId As String
    Dim execInfo As New reporting.ExecutionInfo
    Dim execHeader As New reporting.ExecutionHeader
    Dim lstrHistoryId As String = String.Empty
  
    Try
       Dim rs As New reporting.ReportExecutionService
       Dim deviceInfo As String = "&lt;DeviceInfo&gt;&lt;PageHeight&gt;8.5in&lt;/PageHeight&gt;&lt;PageWidth&gt;11in&lt;/PageWidth&gt;&lt;MarginLeft&gt;0.25in&lt;/MarginLeft&gt;&lt;MarginRight&gt;0.25in&lt;/MarginRight&gt;&lt;MarginTop&gt;0.25in&lt;/MarginTop&gt;&lt;MarginBottom&gt;0.25in&lt;/MarginBottom&gt;&lt;/DeviceInfo&gt;"
       rs.Credentials = System.Net.CredentialCache.DefaultCredentials
       Dim params As New List(Of reporting.ParameterValue)
       Dim param As reporting.ParameterValue
       rs.Credentials = System.Net.CredentialCache.DefaultCredentials
  
       For Each lInputParam In plstParams
          param = New reporting.ParameterValue
          param.Name = lInputParam.Name
          param.Value = lInputParam.Value
          params.Add(param)
       Next
  
       rs.ExecutionHeaderValue = execHeader
       execInfo = rs.LoadReport(pstrReportPath, lstrHistoryId)
       rs.SetExecutionParameters(params.ToArray, "en-us")
  
       lResults = rs.Render(pstrExportFormat, deviceInfo, "", "", "", Nothing, Nothing)
    Catch ex As Exception
       Throw
    End Try
    Return lResults
  </code></pre>
  
  <p>End Function</p>
  
  <p>Some additional information, this code is from an app built in VS 2012 Pro and targets the .NET 2.0 framework.  I have tried targeting a newer framework but that gives me a different ReportExecutionService object altogether and I can't assign credentials in the same way, the Render method is also different in that case.</p>
  
  <p>Any ideas on a workaround, or a better way to render reports programmatically? Thanks.</p>