locked
Crystal Reports : Table Doesn't exists Error RRS feed

  • Question

  • User1171172248 posted

    Hello People

    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

    Monday, June 9, 2014 7:24 AM

All replies

  • User-37275327 posted

    You need to check each step,

    • Make sure that datatable is fill with data correctly.
    • 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.
    Tuesday, June 10, 2014 3:50 AM
  • User1171172248 posted

    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 ?

    Thanks

    Tuesday, June 10, 2014 4:07 AM
  • Tuesday, June 10, 2014 5:13 AM
  • User1171172248 posted

    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" ??

    Wednesday, June 11, 2014 4:28 PM
  • User-37275327 posted

    I am trying get the head around on this. Few questions,

    • Did you duplicate the report from "GenderSample" when creating "Apartment" report? If so, error is obvious

    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.

    Wednesday, June 11, 2014 11:13 PM