This is a migrated thread and some comments may be shown as answers.

HTML Viewer refresh error after initial success

1 Answer 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 2
Kenneth asked on 27 Jun 2017, 01:49 PM

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

 


1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 29 Jun 2017, 01:24 PM
Hi Kenneth,

Please check the cases in which the Reporting REST Service's ReportResolver is used - Purpose and Usage of the Reporting REST Service Resolver. On each call you need to return the same report instance as before per viewer (client).

Please debug the Resolve method of the custom resolver and if each interaction with the report in the viewer submits the same information to the resolver. If you change something in the report, this will invalidate the record for the already displayed document and it will lead to an error stating that it is not the same document (report with ID XXXX cannot be found).

Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Kenneth
Top achievements
Rank 2
Answers by
Stef
Telerik team
Share this question
or