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

Pass Value to Filter from Link

3 Answers 157 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 17 Dec 2009, 10:20 PM

How to I setup my filter to select the value I pass it from a webpage?

<button onclick="openWin('<%# Eval("pws_id") %>'); return false;">Open Print Window</button> 

 

function openWin(PWSID) {

 

radopen(

"print.aspx?pws_id=" + PWSID);

 

}

3 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 18 Dec 2009, 06:52 AM
Hello bradley baker,

As far as we see you want to pass a query string to a report filter. You're probably aware that report filters are most commonly used with report parameters and this is the easiest way to achieve what you're after:

  1. Setup a report filter that depends on a report parameter.
  2. Pass a value from query string to the report parameter e.g.:

    string query = (string)Request.QueryString["MyKey"];
                if (query != null)
                {
                    Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report;
                    report.ReportParameters["MyParam"].Value = query;
                }
Hope this helps.
Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David V
Top achievements
Rank 1
answered on 02 Oct 2013, 09:30 PM
Hello I'm trying to use this code with Q2 2013 but get a warning that it is obsolete
Warning 1 'Telerik.ReportViewer.WebForms.ReportViewer.Report' is obsolete: 'Telerik.ReportViewer.WebForms.ReportViewer.Report property is now obsolete. Please, use the Telerik.ReportViewer.WebForms.ReportViewer.ReportSource property instead.
If I try to replace 'Telerik.ReportViewer.WebForms.ReportViewer.Report'  with Telerik.ReportViewer.WebForms.ReportViewer.ReportSource  the code does not work it tells me I can't access the parameters with an Index like ["myindex"].value
How to I upgrade to correct (non obsolete) code?
0
Nasko
Telerik team
answered on 07 Oct 2013, 02:11 PM
Hi Bradley,

To set the parameter value you can use the InstanceReportSource as shown in the following code:
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource = (Telerik.Reporting.InstanceReportSource)this.reportViewer1.ReportSource;
instanceReportSource.Parameters.Add("myParam", "paramValue");

Regards,
Nasko
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Steve
Telerik team
David V
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or