Last post Jun 11, 2014 11:13 PM by cnranasinghe
Jun 09, 2014 07:24 AM|circut009|LINK
I have two crystal reports with same ms access database. One crystal report with using table"GenderSample" is working. While the other report using table "Apartment" is not working. I am using two .aspx files to export crystal report into PDF. Both use the
same code but using different datatables.
Bolow code is givng me error that "The Microsoft Jet database engine cannot find the input table or query "Apartment".
Though the table " Apartment" is there in the database.
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = cn;
cmd.CommandText = "select * from Apartment"; // other crystal report uses GenderSample instead of Apartment
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = cmd;
DataTable datatable = new DataTable();
da.Fill(datatable); // getting value according to imageID and fill dataset
ReportDocument crystalReport = new ReportDocument(); // creating object of crystal report
crystalReport.Load(Server.MapPath("~/CopyofCrystalReport.rpt")); // path of report
crystalReport.SetDataSource(datatable); // binding datatable
CrystalReportViewer1.ReportSource = crystalReport;
crystalReport.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "PersonDetails");
* Note: This error is on the production server on localhost the same thing is working well.
Please let me know what could be the cause. Thanks
Jun 10, 2014 03:50 AM|cnranasinghe|LINK
You need to check each step,
Jun 10, 2014 04:07 AM|circut009|LINK
The database on production server is working as i am able to pull out data on other crystal report using GenderSample Table. The issue is with other crystal report using different table.
Both crystal report have same database & connection string . Code on page load is same but the select query part is using different table
If population ok, then you need to check CopyofCrystalReport.rpt schema is correct. I guess your rpt file schema is reading your local database. if you can not get rid of connection desing the report using dataset, check this or
verify the datase from the production server.
how can i check rpt schema is reading right database or not ?
Jun 10, 2014 05:13 AM|cnranasinghe|LINK
Check this reference
Jun 11, 2014 04:28 PM|circut009|LINK
The database for both reports is same, the tables are different. One report is working while other is not. Why doesn't the Crystal Report, On The Production Server beahve the same way as it behaves on LocalHost. Why is there dfferences.
Can you help me with some reference on " Multiple Table Crystal Reports using MS Access Database" ??
Jun 11, 2014 11:13 PM|cnranasinghe|LINK
I am trying get the head around on this. Few questions,
The problem here i guess is, you are passing Apartment table for a report which is refering different table (probably Gender table). Try redesing the Apartment report and redeploy.