Reporting 8.1.14.804
Using HTML Viewer, implemented reporting api and report renders perfectly. In the api I am using a customreportresolver so I can pass url parameters that control the report sorting and filtering.
After the report initially renders if I hit refresh the first time I get an error:
Error creating report document (Report = ItemReport?key=12345&sortBy=0&allDates=true&ReportTitle=it works!; Format = HTML5Interactive):
Report instance with ID '082320-e65f' not found.
A second click of refresh renders the report correctly with no error.
Tracing through the custom resolver shows it executes without an error on the refresh request.
The report controller:
Protected Overrides Function CreateReportResolver() As Telerik.Reporting.Services.Engine.IReportResolver
Return New CustomReportResolver
End Function
The custom resolver:
Public Function Resolve(reportId As String) As Telerik.Reporting.ReportSource Implements Telerik.Reporting.Services.Engine.IReportResolver.Resolve
Dim theReport = reportId.Substring(0, reportId.IndexOf("?"))
Dim rpt As Object = Nothing
Select Case theReport
Case "ItemReport"
rpt = New Reports.ItemReport
End Select
Dim queryString As String = reportId.Substring(reportId.IndexOf("?") + 1)
Dim params As NameValueCollection = HttpUtility.ParseQueryString(queryString)
For Each k As String In params
rpt.ReportParameters(k).Value = params(k)
Next
Dim sb As New StringBuilder
Using xmlWriter As System.Xml.XmlWriter = System.Xml.XmlWriter.Create(sb)
Dim xmlSerializer As New Telerik.Reporting.XmlSerialization.ReportXmlSerializer()
xmlSerializer.Serialize(xmlWriter, rpt)
End Using
Dim reportSource As New Telerik.Reporting.XmlReportSource()
reportSource.Xml = sb.ToString
Return reportSource
End Function