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

i can't pass parameter to Telerik Report

1 Answer 193 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ahmed
Top achievements
Rank 1
ahmed asked on 17 Oct 2015, 12:43 AM

i have ReportViewer1 in Report1.aspx with uri= Report1.trdx wich have int parameter "si"

in code page of Report1.aspx.cs i write :

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            //Telerik.Reporting.UriReportSource uriReportSource =  new Telerik.Reporting.UriReportSource();
            //uriReportSource.Uri = "Report1.trdx";
            //Int32 ss = (int)(Session["u_id"]);
            //uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("si", ss.ToString()));  

            Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
            typeReportSource.TypeName = typeof(Report1).AssemblyQualifiedName;
            Int32 ss = (int)(Session["u_id"]);
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("si", ss));
        }
    }
 but not working , helpe me please

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 21 Oct 2015, 11:38 AM
Hi Ahmed,

Please check if the name of the report parameter is the same, including the characters case, as the one added in the ReportSource.Parameters collection. Then debug if you are actually obtaining any value from the used session variable.

In case you are using AJAX in the application, check how the viewer is update - AJAX support.
Also verify you are using the correct report source type depending on the type of report - Report Sources.


I hope this information is helpful.

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