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

Setting value for parameters on page load

1 Answer 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edd
Top achievements
Rank 1
Edd asked on 08 Apr 2014, 03:45 PM
I have a designed report class which is called into another application using a report viewer.
But the problem here is that on page load i want to fill in the report parameter with a value with the code below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Reporting;
using ReportTestss;
using ReportInstantiate;
 
namespace ReportInstantiate
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                test report = new test();
                report.ReportParameters["StudID"].Value = "SCH10001/2013";
            }
        }
    }
}

This code is not working for me.
What can be the issue.

1 Answer, 1 is accepted

Sort by
0
Accepted
KS
Top achievements
Rank 1
answered on 11 Apr 2014, 12:23 PM
Hi,

The code is OK, just show the report in the viewer -

var irs = new Telerik.Reporting.InstanceReportSource();
irs.ReportDocument = report;
this.ReportViewer1.ReportSource = irs;

-KS
Tags
General Discussions
Asked by
Edd
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Share this question
or