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

In ReportViewer, there is no data to view.

0 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jai
Top achievements
Rank 1
jai asked on 24 Mar 2011, 03:46 PM
Hi,
Im new to telerik.reporting
and im trying to load my dataset and binding in report, but im not able to see any data in viewer.. these are the below steps im doing..

.aspx page

 <telerik:ReportViewer Width="100%" Height="100%" ID="ReportViewer1" runat="server" ></telerik:ReportViewer>

.aspx.cs

protected void Page_Load(object sender, EventArgs e)
        {
            Telerik.Reporting.Report report1 = new Telerik.Reporting.Report();
            report1.DataSource = GetDataset();
            ReportViewer1.Report = report1;            
        }

        private DataTable GetDataset()
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            DataRow dr;

            DataColumn id = new DataColumn("ID");
            DataColumn name = new DataColumn("Name");
            dt.Columns.Add(id);
            dt.Columns.Add(name);
            dr = dt.NewRow();
            dr["ID"] = 1;
            dr["Name"] = "Jeyaraman";
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr["ID"] = 2;
            dr["Name"] = "Axiom";
            dt.Rows.Add(dr);

            ds.Tables.Add(dt);
            return dt;
        }

Plz guide me to fix the issue...

Thanks in advance
Jeyaraman.S

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
jai
Top achievements
Rank 1
Share this question
or