Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report is empty (Ado.net DataSet)

Status
Not open for further replies.

lutzs

Programmer
Oct 8, 2002
75
LU
Hi,

i generate a ADO.net DataSet Object and connect a report to this DataSet Object.
My datasource is an oracle database.
I set the connection with oledb (namespace: system.data.oledb).
I build the windows application and start without debugging
but the result report is: I see just the report header, no data!
Where's the problem?

oRpt = new CrystalReport2 ();

/* Use ADO.net object model to set up connection information */
OleDbConnection oleConn = new OleDbConnection
("Provider=MSDAORA.1" +
//Username
";User Id=user" +
//Password
";Password=pwd" +
//Replace with your datasource value
";Data Source=name");



OleDbDataAdapter oleAdapter = new OleDbDataAdapter("SELECT * FROM table", oleConn);

Dataset1 dataSet = new Dataset1();
/* Connect to, fetch data and disconnect from database */
oleAdapter.Fill (dataSet, "Customer");

/* Use Report Engine object model to pass populated dataset to report */
oRpt.SetDataSource (dataSet);

/* bind report object with data to the CRViewer */
crystalReportViewer1.ReportSource = oRpt;

Thanks,
Stephanie
 
This may be too late to help you, but it may help someone else... Here's what I grabbed off a crystal forum posting:

"When you fill a DataSet using the DataAdapter.Fill method, you must use the overloaded method that takes a table name as well and give the table the same name that the report was designed against. If you don't, the report will come up blank."



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top