Click here to Skip to main content
15,888,908 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi there,

I need to produce a report based on which month and year user choose in the combobox dropdown. How do I start to do this? Must I use the SQL Expression Fields and Parameters? I'm kinda lost.

Thanks.
Posted

 
Share this answer
 
Comments
Manoj Kumar Choubey 4-Apr-12 1:45am    
You can use pass dataset to report doc :

// code to get data from the DB
DBConnection DBConn = new DBConnection();
OleDbDataAdapter myDataAdapter = DBConn.getDataFromDB();

// use the created Dataset to fill it with data got
// from the DB by using the DataAdapter
DataSet dataReport = new DataSet();
myDataAdapter.Fill(dataReport,"myPersonalInfoTable");
// create a new report from the created CrystalReport
myDataReport myDataReport = new myDataReport();

// set the data source of the report
myDataReport.SetDataSource(dataReport);

// set the report source of the created “crystalReportViewer”
// component to the created report
crystalReportViewer1.ReportSource = myDataReport;

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