Please help.

i have an application made in C# using ms studio 2008. I have created the data source from my access 2003 database. But every time I select the data in the crystal report wizard. It only displays the fields from the database I have connected but not the data. is there a tutorial or link or someone who can assist me in displaying data from access database to a crystal report.:(

Dani AI

Generated

Short summary: the blank fields happened because the report had the schema but was never given populated rows at runtime. As suggested, pushing a filled DataSet into the report fixed the immediate problem and confirmed it worked. The next step—binding an Access query—follows the same push-model pattern.

Recommended workflow to use an Access query with Crystal (push dataset):

  • Create a typed DataSet in the project that matches the query columns. Add a TableAdapter or an ADO.NET adapter that runs the SELECT or the saved Access query.
  • Design the .rpt from the Project Data -> ADO.NET DataSets entry so the report uses the DataSet schema (not a live DB connection).
  • At runtime fill the DataSet, verify it actually contains rows in the debugger, then set the ReportDocument data source to that DataSet and assign the report to the viewer.
  • If the report has subreports, set each subreport's data source separately.

Troubleshooting and cautions:

  • Ensure “Save Data With Report” is unchecked in the designer so the viewer doesn’t show stale data.
  • Verify the Access file path and OS permissions; on 64-bit systems Jet.OLEDB.4.0 is not available—either use ACE.OLEDB or compile to x86.
  • Run Verify Database in the Crystal designer after schema changes and keep the Crystal runtime version consistent with the designer.
  • Dispose/Close the ReportDocument to release file locks and free resources.

Recommended Answers

All 3 Replies

You forget the following code in a Form_Load Event

DataSet1 ds = new DataSet1();
  DataSet1TableAdapters.empTableAdapter a = new WindowsFormsApplication1.DataSet1TableAdapters.empTableAdapter();
            a.Fill(ds.emp);

            CrystalReport11.SetDataSource(ds);

thanks for the code. I will try it out tonight keep you posted

Thanks it worked now just trying to connect my query

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.