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

Reporting Parameters

4 Answers 349 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 27 Jun 2014, 01:39 PM
Hello, I am trying to get my first report working with .NET MVC and the Reporting Q2 2014 HTML5 viewer. I was able to create a report viewer page in my application and view the sample reports, but have been unable to pass a report parameter to my custom report. I used the standalone designer to create the .trdx file, specified a parameter (ClientID) to be passed to the datasource, which is a SQL datasource that calls a stored procedure. That stored procedure has a single parameter, @clientID, which is mapped to the report ClientID parameter. The report parameter is an integer, and will eventually be set to visible = false when I get all of this sorted out.

Using the preview feature of the standalone designer, I got the same error that I see in my web application ('Missing or invalid parameter value. Please input valid data for all parameters.') until I made the parameter visible and entered a value. Once I did that, data was correctly returned. I am passing the report parameters like so:

@{
    var reportSource = new UriReportSource() {
        Uri = Url.Content("EligibilitySummary.trdx")
    };
    reportSource.Parameters.Add(new Parameter("clientID", Clients.GetByAuthenticatedUser().ClientID));
 
    @(Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
        .ServiceUrl(Url.Content("/api/reports/"))
        .TemplateUrl(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.618.html"))
        .ReportSource(reportSource)
        .ViewMode(ViewModes.INTERACTIVE)
        .ScaleMode(ScaleModes.SPECIFIC)
        .Scale(1.0)
        .PersistSession(false));
 }

When the page loads, a breakpoint on the reportSource lines shows that the parameter values are correctly set, and when the report viewer is displayed, the parameter value shows in the parameters pane on the right hand side, but clicking 'Preview' simply repeats the parameter missing message.

I'm not sure where I've gone wrong in the binding on the web side - some older posts mentioned a version of Newtonsoft.JSON being in the GAC might cause a problem - I have verified that's not the case here.

Any ideas where I've mis-stepped? 

Thanks!

4 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 27 Jun 2014, 02:44 PM
Well, that was foolish on my part - I looked in the GAC to make sure that I didn't have Newtonsoft.JSON installed, but then it occurred to me that I might have it installed in the project itself. Updating to the latest available package via nuget cured the problem.
0
Swapnil
Top achievements
Rank 1
answered on 06 Oct 2014, 12:31 PM
I am getting same issue. Your solution help me. Thanks....
0
Rajesh
Top achievements
Rank 1
answered on 17 Oct 2014, 09:04 PM
Hello,
            I am getting same error.Please suggest me solution.
0
Stef
Telerik team
answered on 22 Oct 2014, 08:58 AM
Hello Rajesh,

The solution discussed in this thread is related to updating Newtosoft.Json.dll via Nuget. For further troubleshooting steps, please check this forum thread: HTML5 Report Viewer - Export options are missing.

If you need further help, feel free to open a support ticket and send us details about the problem and Fiddler's log file.

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
Brandon
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Swapnil
Top achievements
Rank 1
Rajesh
Top achievements
Rank 1
Stef
Telerik team
Share this question
or