G
Guest
I've populated a DataSet in my C# program and verified that it contains the
data I passed it. I've then created a blank CrystalReport and set it's
DataSource to my DataSet. Then I created a CrystalReportViewer and set it's
ReportSource to my CrystalReport. When I run the program though nothing get's
shown in my viewer. The following is how I did it...
OdbcConnection dbConn = new OdbcConnection();
OdbcCommand dbCommand = new OdbcCommand();
OdbcDataAdapter dbAdap = new OdbcDataAdapter();
DataSet dbData = new DataSet();
CrystalReport1 report = new CrystalReport1();
dbConn.ConnectionString = @"DSN=Crystal;";
dbConn.Open();
dbCommand.CommandText = "SELECT * FROM Student ORDER BY studentid";
dbCommand.Connection = dbConn;
dbAdap.SelectCommand = dbCommand;
dbAdap.Fill(dbData, "Students");
report.SetDataSource(dbData);
reportViewer.ReportSource = report;
I don't want to use the wizard that comes with VS .NET because I want to
completely understand Crystal Reports and be able to manipulate the report
just by editing the DataSet by using SQL commands.
Any ideas?
Darrell
data I passed it. I've then created a blank CrystalReport and set it's
DataSource to my DataSet. Then I created a CrystalReportViewer and set it's
ReportSource to my CrystalReport. When I run the program though nothing get's
shown in my viewer. The following is how I did it...
OdbcConnection dbConn = new OdbcConnection();
OdbcCommand dbCommand = new OdbcCommand();
OdbcDataAdapter dbAdap = new OdbcDataAdapter();
DataSet dbData = new DataSet();
CrystalReport1 report = new CrystalReport1();
dbConn.ConnectionString = @"DSN=Crystal;";
dbConn.Open();
dbCommand.CommandText = "SELECT * FROM Student ORDER BY studentid";
dbCommand.Connection = dbConn;
dbAdap.SelectCommand = dbCommand;
dbAdap.Fill(dbData, "Students");
report.SetDataSource(dbData);
reportViewer.ReportSource = report;
I don't want to use the wizard that comes with VS .NET because I want to
completely understand Crystal Reports and be able to manipulate the report
just by editing the DataSet by using SQL commands.
Any ideas?
Darrell