Click here to Skip to main content
15,909,373 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello frens, i am doing a project and in that project i m facing a particular project. i have datas in two separate tables namely tblCustomer and tblVehicle, what i need to do is generate a slip in crystal report but it includes column names from these two tables i have done the crystal report generation from single table through the code

C#
string sql = "select Vehentrytime,Vehlane from tblVehicle where Vehid=" + vehicleid + "";

 SqlCommand cmd = new SqlCommand(sql, cnn);
 SqlDataAdapter dscmd = new SqlDataAdapter(cmd);
   DataSet ds = new DataSet();
 dscmd.Fill(ds, "Vehicle");
 cnn.Close();
CrystalReport1 objRpt = new CrystalReport1();
objRpt.SetDataSource(ds.Tables["Vehicle"]);
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh();


but not from two table, please provide with the code
Posted
Updated 31-Oct-11 6:06am
v2
Comments
Sergey Alexandrovich Kryukov 11-Feb-13 2:05am    
Please never put your comments as "solution", this is the abuse.
—SA

1 solution

You should add multiple tables in crystal report source at the time of designing the crystal report.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900