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

Report Parameters from ReportViewer to Report itself

2 Answers 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
faisal
Top achievements
Rank 1
faisal asked on 06 Nov 2015, 05:09 PM

Hi,

 

Hope you are fine.

 

I am passing parameter from reportviewer to report like

TypeReportSource trs = new TypeReportSource() { TypeName = typeof(TYMReporting.Reports.ZoneReport1.ZoneReportTelerik).AssemblyQualifiedName };
trs.Parameters.Add(new Telerik.Reporting.Parameter("ID","1"));
 
@(Html.TelerikReporting().ReportViewer()
        // Each report viewer must have an id - it will be used by the initialization script
        // to find the element and initialize the report viewer.
        .Id("reportViewer1")
        // The URL of the service which will serve reports.
        // The URL corresponds to the name of the controller class (ReportsController).
        // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
        .ServiceUrl(Url.Content("~/api/reports/"))
        // The URL for the report viewer template. The template can be edited -
        // new functionalities can be added and unneeded ones can be removed.
        // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
        .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-9.1.15.731.html"))
        // Strongly typed ReportSource - TypeReportSource or UriReportSource.
        .ReportSource(trs)

So kindly tell me how can i get the passed parameter on report page. i am trying to get like

public ZoneReportTelerik()
        {
            InitializeComponent();
             
            var dal = new DataEntities();
            var zoneReport = new DataSet();
            var ID=this.ReportParameters["ID"].Value;
}

but its not getting the parameter. it always returns null. kindly guide me please.

 

REgards,

 

Faisal

2 Answers, 1 is accepted

Sort by
0
faisal
Top achievements
Rank 1
answered on 09 Nov 2015, 06:28 AM

Hi,

 

Please reply telerik team. i am really stuck into this issue. waiting for your response from last 3 days.

 

Regards,

 

Faisal

0
Nasko
Telerik team
answered on 11 Nov 2015, 12:32 PM
Hello Faisal,

The run-time report parameter value will not be available inside the report constructor code. You need to use the processing report instance, which can be accessed using Events. However, we recommend that you access the report parameter value inside the report using Expressions instead of custom code.

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