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

Send value from MVC View to Teleik Report BackEnd

1 Answer 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nimish
Top achievements
Rank 1
Nimish asked on 31 Jul 2015, 01:45 PM

I have my  Report in MVC and displaying the report in IFrame. I have search Fields Parameters and In report I want to use those fields. 

Means my main point to is to send the value from MVC view to  Report Backend code. I think it should be something by setting report parameter. 

But I do not how? I have set for help. 

I need urgent help.

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 03 Aug 2015, 12:55 PM
Hello Nimish,

Using the HTML5 Report Viewer, you can pass a report parameter to the report via the repotSource.parameters object with properties name/value equal to the report parameters’ names and values used in the report definition:
<script type="text/javascript">
        $("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "/api/reports/",
                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-x.x.x.x.html',
                reportSource: {
                    report: "MyReport.trdx",
                    parameters: {
                        Parameter1: "John Doe"
                    }
                }
            });
</script>

Using the MVC Report Viewer, you can achieve the same by adding the parameter values to the ReportSource.Parameters collection:
@{
    var uriReportSource = new UriReportSource() { Uri = "MyReport.trdx" };
    uriReportSource.Parameters.Add("Parameter1", "John Doe");
}
 
@(
    Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
        .ServiceUrl("/api/reports/")
        .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate-x.x.x.x.html")
        .ReportSource(uriReportSource)
)


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