Add more datatable to report
Posted: Thu Jan 21, 2010 3:24 am
i design report in designer with dataset source that have two tables
i want to fill them with my data table in application code at print button click
i write below code to do this
when i have on datatable in dataset i have no problem and one data bound will fill at report but when add second dt to dataset no data show at report
class1 clsRecord = new class1();
class2 clsRecord2 = new class2();
DataSet ds1 = new DataSet();
DataTable dt1= new DataTable();
DataTable dt2 = new DataTable();
dt2 = clsRecord.Get_All_Record();
dt1 = clsRecord2.Get_All_Record();
stiReport1.Load(Application.StartupPath + "\\Reports\\rep1.mrt");
ds1.Tables.Add(dt1);
ds1.Tables.Add(dt2);
stiReport1.RegData(ds1);
stiReport1.Dictionary.Synchronize();
stiReport1.Show();
i want to fill them with my data table in application code at print button click
i write below code to do this
when i have on datatable in dataset i have no problem and one data bound will fill at report but when add second dt to dataset no data show at report
class1 clsRecord = new class1();
class2 clsRecord2 = new class2();
DataSet ds1 = new DataSet();
DataTable dt1= new DataTable();
DataTable dt2 = new DataTable();
dt2 = clsRecord.Get_All_Record();
dt1 = clsRecord2.Get_All_Record();
stiReport1.Load(Application.StartupPath + "\\Reports\\rep1.mrt");
ds1.Tables.Add(dt1);
ds1.Tables.Add(dt2);
stiReport1.RegData(ds1);
stiReport1.Dictionary.Synchronize();
stiReport1.Show();