Hasibul Haque
Check me out on the web at Untitled Page or at my blog.
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Looking at the Report Viewer Control
May 17, 2010 at 12:55 AMThanks for wonderful post. It helps me for creating rdlc report.
Now i need another help.
I need to add two tables/procedures in my report.
My report have two section. One is Header and another is details.
I sgall use companyInfo table for header and use TransactionInfo for detail section.
But i am unable to add two table of data Programmatically.
The report talke only one table with specific datasource name.
How i can load twho table at a time.
consider following code which i have used for retriveing single data table.
string sqlQ = "Select * from CompanyInfo";
string sqlQ1= @"Select * from command_1 where operationType = 2";
DataSet ds = new DataSet() ;
SqlConnection con = new SqlConnection("Data Source=ITSOFT206; initial catalog=rbrl;user id = sa;password=start777");
con.Open();
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(sqlQ , con);
SqlDataAdapter da1 = new SqlDataAdapter(sqlQ1, con);
da.Fill(dt);
da1.Fill(dt1);
dt.TableName = "CompanyInfo";
dt1.TableName = "command_1";
ds.Tables.Add(dt.Copy ());
ds.Tables.Add(dt1.Copy());
da.Dispose();
da1.Dispose();
con.Close();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport lc = ReportViewer1.LocalReport;
lc.ReportPath = "Report1.rdlc";
ReportDataSource rds = new ReportDataSource();
rds.Name = "rptSource_command_1";
rds.Value = ds.Tables["command_1"];
lc.DataSources.Add (rds);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.LocalReport.Refresh();
hope i will get solution.