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

Error while rendering "HTML 5 Report Viewer" on client side

1 Answer 174 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yashad
Top achievements
Rank 1
Yashad asked on 19 Sep 2017, 03:42 PM

Hello,

I have created a Telerik Reporting REST service in order to render "telerik reports" on my Web Application in HTML 5 view. I am currently using the following code on my Web Application page "Report.aspx" to consume the service.

 <script type="text/javascript">
       
        $("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "http://localhost:62355/api/reports/",
                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate.html',
                reportSource: {
                    report: "VB.ReportLibrary.ReportCatalog, VB.ReportLibrary",
                    parameters: {
                    }
                },

                viewMode: "ViewModes.INTERACTIVE",
                scaleMode: "ScaleModes.SPECIFIC",
                scale: "1.0",
                PersistSession: "true"

            });
       
    </script>

When I open "Report.aspx" it throws an error "Client with ID '[object Object]' not found. Expired" on locally running Service App (See attached image "ServiceError.jpg"). At the same time client side(Web App page Report.aspx) shows an alert message "Gone" (See Image 410_Gone.jpg). ReportsController.vb code is as follows:

Imports Telerik.Reporting.Cache.Interfaces
Imports Telerik.Reporting.Services.Engine
Imports Telerik.Reporting.Services.WebApi
Imports System.IO
Imports System.Web.Http.Cors

'The class name determines the service URL.
'ReportsController class name defines /api/report/ service URL.

<EnableCors("http://localhost:53274", "*", "*")>
Public Class ReportsController
    Inherits ReportsControllerBase

    Shared configurationInstance As Telerik.Reporting.Services.ReportServiceConfiguration

    Shared Sub New()
        'This is the folder that contains the trdx or trdp report definitions
        'In this case this is the Reports folder
        Dim appPath = HttpContext.Current.Server.MapPath("~/")
        Dim reportsPath = Path.Combine(appPath, "Reports")

        'Add resolver for trdx report definitions,
        'then add resolver for class report definitions as fallback resolver;
        'finally create the resolver and use it in the ReportServiceConfiguration instance.
        Dim resolver = New ReportFileResolver(reportsPath) _
                       .AddFallbackResolver(New ReportTypeResolver())

        'Setup the ReportServiceConfiguration
        Dim reportServiceConfiguration As New Telerik.Reporting.Services.ReportServiceConfiguration()
        reportServiceConfiguration.HostAppId = "reportViewer1"
        reportServiceConfiguration.ReportResolver = resolver
        reportServiceConfiguration.Storage = New Telerik.Reporting.Cache.File.FileStorage()
        reportServiceConfiguration.ReportSharingTimeout = 0
        reportServiceConfiguration.ClientSessionTimeout = 9999
        configurationInstance = reportServiceConfiguration
    End Sub

    Public Sub New()
        'Initialize the service configuration

        Me.ReportServiceConfiguration = configurationInstance
    End Sub

    Protected Overrides Function CreateCache() As ICache
        Return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache()

    End Function

End Class

 

Can you please provide a solution regarding same. My end goal is to render telerik report on web form page using html 5 report viewer (See expected_result.jpg).

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 20 Sep 2017, 05:38 PM
Hello yashad,

You can check an update in support ticket #1131079 that was opened for the same issue.

In general, errors related to expired/missing ClientID can occur if you use the Reporting REST Service in a web farm or with load balancing, without using the correct Storage settings - REST Service Storage.

The reason is that with load balancing and FileStorage option you may have the cache folder created on different machines, unless you specify a common shared folder through the second overload of the FileStorage.


Regards,
Katia
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
Yashad
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or