cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to open database file when exporting crystal report

0 Kudos

I have created a crystal report and showing fields from DataSet everything works perfectly when i export it to any format it generates a error Unable to open database file and it shows 3 to 4 times in dialog box same error then exported the file successfully, error is generating first time only during exporting after that when i export second time and so on it exported successfully without any issue.

Error message during exporting:

I am unable to figure out the problem from last 2 days and already searched about solution but didn't get any solution yet.

My code:

using (SQLiteConnection con = new SQLiteConnection(AppSettings.ConnectionString()))
{
    con.Open();
    using (SQLiteDataAdapter sda = new SQLiteDataAdapter("SELECT * FROM formData", con))
    {
        sda.Fill(dataSet, "LawData");
        Law_Report objRpt = new Law_Report();
        objRpt.SetDataSource(dataSet);
        ReportViewer.ReportSource = objRpt;
        ReportViewer.Refresh();
    }
    con.Close();
}

I checked the Debugging and i am getting error on the following link, its checking for database file on the this link but why it's checking for database file in this directory? when i manually paste my database file it's working fine but i can't copy my db file in this directory in client machine due to admin privilege

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\myDatabase.db

DellSC
Active Contributor
0 Kudos

Which version of the SDK are you using?

0 Kudos

Crystal Report Version: SP 25

SDK:

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Then you need to debug more in your main project.

Answers (4)

Answers (4)

0 Kudos

Can you test using the MS SQL Native 11 Client?

Did you enable CRLogger and see what it shows?

0 Kudos

I tried my code and report in new project and it's successfully exported without any issue but not working on my main project.

0 Kudos

First is to upgrade to SP 26, SP 25 was not fully integrated into VS 2019:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Using google I found multiple makers of a product called SQLLite. I suggest contacting them to fix their driver.

To enable DB logging in CR search for this KBA:

https://launchpad.support.sap.com/#/notes/1603398

Send them the logs.

CR follows ODBC 3 standards, something is triggering the error, CR is simply passing that error to you from that client.

Don

0 Kudos

Done all the steps upgraded my crystal report version from SP 25 to SP 26 but my issue isn't resolved yet unable to figure the problem

0 Kudos

Why did you paste the Microsoft .net Core.... then?

Where did you get that client SQLiteConnection from, I don't see it in my list.

What version of VS are you using?

0 Kudos

Visual Studio 2019 and using SQLite ODBC Driver

0 Kudos

We don't support .NET Core nor the Data Connector. Use MS SQL Native 11 client to connect to your dB.

0 Kudos

I am using .NETFramework 4.6 not .NET Core