Hello,
In my current project I am using crystal report for displaying the data. I have used following code for the stated task.
this.Height = Screen.PrimaryScreen.Bounds.Height;
this.Width = Screen.PrimaryScreen.Bounds.Width;
this.Top = 0;
this.Left = 0;
crystalReportViewer1.Height = this.Height - 60;
crystalReportViewer1.Width = this.Width - 5;
crystalReportViewer1.Top = 10;
crystalReportViewer1.Left = 0;
TourCrystalReport tcr = new TourCrystalReport();
tcr.SetDataSource(_ds);
crystalReportViewer1.ReportSource = tcr;
But unable to get the data displayed in crystal report. Can anyone help me with this.
Thanks,
Minakshi.
Loading

mihir soni41 reputationPosted May 9, 2010, 9:12 PM EDT
or if you still face problem use the following code
Take new project and in that first select database and all this thing after that Add new Dataset Configure it with your req and save it..
After This step add new Crystal report in that crystal report add dataset which you have created earlier after finishing all the steps just Save it and go to your Form..
In form first put Crystal report viewer and write following code on Load event
// 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;