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

HTML5 Report Viewer Datasource parameters

1 Answer 211 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 Oct 2014, 07:24 PM
I'm working on the HTML5 Telerik Report Viewer and I'm running into issues with my parameterized datasource. In the report I have a stored procedure that takes a parameter that is bound to a report parameter. This works perfectly in the report designer; however, when I view the report through the HTML5 viewer, I get the following error:

An error has occurred while processing Graph 'stkdChart': Procedure or function 'rptSproc' expects parameter '@TargetDate', which was not supplied.

However, I am passing the report parameter TargetDate with the report. I can see the report parameter in a text box. I'm assuming that the stored procedure's parameter isn't linked to the report parameter from the HTML viewer for some reason.  I'm setting up my report parameters like so

$('#reportViewer1').telerik_ReportViewer({
    serviceUrl: siteRoot + "api/Reports/",
    templateUrl: siteRoot + "ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html",
    reportSource: {
        report: "Snapshot.trdx", "parameters": {
            TargetDate: "\/Date(1413224249612)\/"
        }
    },
    viewMode: "INTERACTIVE",
    scaleMode: "SPECIFIC",
    scale: 1,
    persistSession: false,
    printMode: "AUTO_SELECT"
});

So, could someone point to a way to bind the stored procedure's parameter to the report parameter with the HTML5 viewer? Do I need a custom Resolver, instead of the default ReportFileResolver?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 14 Oct 2014, 01:29 PM
Hello Michael,

If you have configured the SqlDataSource with parameterized query per the SqlDataSource Wizard article.

Please check the following:
  1. Verify the Javascript Date function is evaluated to a valid Date before passing it to the viewer's reportSource.parameters collection.
  2. The date must be passed surrounded by '#' to be recognized as DateTime type.
  3. The Newtosoft.Json.dll in the project is updated to the latest available version through Nuget, and the assembly is not installed on the machine.

To further troubleshoot issues with the HTML5 Report Viewer, download and install Fiddler. In its Inspectos - Request/Response - Raw tabs you can check the made request and the response from the server for any errors.


I hope the above information is helpful.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or