cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to load database information.Error in File BillReport {Some numbers}.rpt

Former Member
0 Kudos

Hi Team I am having problm with Crystal Report for Visual Studio 2013.

I have developed windows application with Crystal Report and Visual Studio 2010.

Now when i try to run same code in VS 2013 with Crystal report for VS 2013. i am getting following error.

Failed to load database information.

Error in File BillReport {A677B982-B8FC-4349-8BE6-9D1DA6B33521}.rpt:

Failed to load database information.

Source : "CrystalDecisions.ReportAppServer.DataSetConversion"

I have used oledb connection to fill XML dataset.

That dataset is binded to Crystal report at run time..

Here is my code.

string sqlstr = "";

                sqlstr = "select * from billMaster where billid =  " + billId + " and merchantName = '"+merchantName+"' ";

cmd = new OleDbCommand(sqlstr, m1.ccon);

                if (m1.ccon.State == ConnectionState.Closed)

                {

                    m1.ccon.Open();

                }

                OleDbDataAdapter da = new OleDbDataAdapter(sqlstr, m1.ccon);

                BillPrint bp = new BillPrint();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

da.Fill(bp.billMaster);

                sqlstr = "select srNo from billInfo where billId=" + billId + " order by srNo";

                DataSet dsTemp = m1.selectData(sqlstr);

                sqlstr = "select (srNo+1-" + dsTemp.Tables[0].Rows[0].ItemArray[0].ToString() + ") as srNo,billId,itemType,itemName,length,width,thickness,squareMeter,billRate,Qty,subTotal from billInfo where billId=" + billId;

                OleDbDataAdapter da1 = new OleDbDataAdapter(sqlstr, m1.ccon);

                // dr = cmd.ExecuteReader();

                da1.Fill(bp.billInfo);

                string path = "";

                path = Application.StartupPath + "\\reports\\BillReport.rpt";

ReportDocument rd = new ReportDocument();

                rd.Load(path);

                rd.SetDataSource(bp);

                crv.ReportSource = rd;

                crv.RefreshReport();

Error occured in rd.setDataSource(bp); statement.

Please help

DellSC
Active Contributor
0 Kudos

Are you connecting to SQL Server?  If so, do you have the "SQL Server Native Client" version 10.0 or 11.0 installed?  That's what the report will need for its connection - the SQL Server client that is automatically installed with Windows is version 6.x and it won't work with Crystal.

-Dell

0 Kudos

Hi Dell,

He's using a dataset, connection to SQL is not required by CR. But I see what you are getting at...

Try saving the DS ( bp ) to xml format and have a look at the data, it may be a data field type has changed with the new OLEDB driver in VS 2013. This may be what Dell is referring to...

Try this:

bp.WriteXml("c:\\sc.xml", XmlWriteMode.WriteSchema);

Then set the report to the xml data source:

System.Data.DataSet ds = new System.Data.DataSet();

ds.ReadXml(@"C:\App_Data\sc.xml", XmlReadMode.ReadSchema);

rpt.SetDataSource(ds);

If that fails then add a Report.VerifyDatabase(); and export to RPT format, open that report up and if you see missing data it's likely the type has changed and as Dell indicated you'll likely need to install the updated SQL Server Client.

One other thing, make sure you have this in your app.config file because it's using the ADO.Plus driver:

<startup useLegacyV2RuntimeActivationPolicy="true">

</startup>

Don

Former Member
0 Kudos

<startup useLegacyV2RuntimeActivationPolicy="true">

</startup>

is the solution man.

Thanks a lot...

I tried this one also..

Try saving the DS ( bp ) to xml format and have a look at the data, it may be a data field type has changed with the new OLEDB driver in VS 2013. This may be what Dell is referring to...

Try this:

bp.WriteXml("c:\\sc.xml", XmlWriteMode.WriteSchema);

Then set the report to the xml data source:

System.Data.DataSet ds = new System.Data.DataSet();

ds.ReadXml(@"C:\App_Data\sc.xml", XmlReadMode.ReadSchema);

rpt.SetDataSource(ds);

but it didn't help..

anyway

<startup useLegacyV2RuntimeActivationPolicy="true">

</startup>


this one is solution..

0 Kudos

Great, that config line is required for the XML data source because it too uses the ADO.NET db driver.

It should work now though...

FYI - if you have a lot of data you will run into memory issues in your dataset. To extend the amount of usable data use the XML work around.

Microsoft protects in memory datasets so CR ( anyone actually ) has to make a copy of the DS and thus doubling+ the amount of memory required. There are also issues if you use multiple tables.

Anything more then 5k rows is about the average limit but that depends on the number of columns also.

Don

Former Member
0 Kudos

Thanks Don. although i have very less amount of data to display in crystal report maximum 40-50 Rows.

What should be ideal way if i have too much data??

I mean shell i linked dataset without creating xml dataset..

0 Kudos

For lots of data connect to the DB directly using ODBC or OLE DB or if we have one use the native Driver ( Example - Oracle Server )

DB servers will always be more efficient collecting and filtering data server side than CR will ever be. And less data coming from the DB server means less network loads and less data for CR to sort...

Don

Former Member
0 Kudos

Hi
Again trapped into same problem.
This time everything works fine while running from visual studio but show same error which i mentioned above after creating  a setup project and installing it to target machine(Which is same).

Please let me know if i need to do any change for setup..

former_member183750
Active Contributor
0 Kudos

The error "Failed to load database information" when using a dataset, indicates that there  is an issue with the dataset. And the report engine at that point attempts to connect to the datasource it was originally designed against. Use the trouble shooting tips in this wiki.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

  Follow us on Twitter

Former Member
0 Kudos

But its working while i debug or run application from visual studio 2013 its working fine.
Do i need to take any special care while creating setup file?

former_member183750
Active Contributor
0 Kudos

As you are working with datasets, other than making sure your app.config is being deployed, no you do not. Remember the app.config must have the same name as your app. E.g.; MyApp.exe, then MyApp.config.

- Ludek

Former Member
0 Kudos

Hi Ludek,

     I am facing the same issue, My installations are all 64 bit. 64 bit run-time, 64 bit oracle client, 64 bit machine. I cant seem to solve this issue. It works fine on my machine but doesn't work on my colleague's machine & the server machine(Windows Server 2012). Can you point me in the right direction, Where am I going wrong.

0 Kudos

Read the WIKI ludek pointed to above.

Make sure your applciation property is set to 64 bit and not AnyCPU.

Don

Former Member
0 Kudos

It was initially set to Any CPU, I changed it to 64 bit and then redeployed on server. still the same error occurs. Also want to point out that the server machine is also 64 bit with 64 bit oracle clients & CR runtime installed on it. I used ODTWithODAC to install the client on server, & used SAP Crystal Reports 64 bit runtime for crystal reports runtime.

In my case the report makes call to the database using the sql command. I am not sure what you mean by a dataset, I am assuming thats and in memory data set, in my case it is fetched from the DB. One more thing, In the wiki, it suggests to examine the xml file to mke sure that correct data is being loaded which the report expects, So if that was the case, it would display the same error on my machine too. The report runs fine on my machine, meaning that the issue with report expecting something is overruled.

Cant figure out what the issue might be. We have to make a shipment on production & we are stuck with this issue for days. Kindly respond.

I tried using the module.exe procedure but I am not sure how can I scope down to the process I am looking for because in my case, The crystal report viewer is loaded in a Web Browser using ASP.Net's .aspx page & injecting the page in an iframe. How am I going to filter out only the dll's that my specific web page is using. Also, If your suggestion is to use Visual Studio IDE to filter the dlls, On server I don't have a development environment and cannot use visual studio IDE to scope to the Report Project only.

Former Member
0 Kudos

Also one more thing, The Application Pool in IIS under which the app is deployed has "Enable32BitAppllication = false" set, both on my local machine as well as server. Reports run on my local machine just fine with the above setting, however on server it gives the database information error.

0 Kudos

If your AppPool is running in 64 bit mode then you need the 64 bit client installed.

Use Modules or ProcessMonitor and look for the dll's your DEV PC is using on the runtime PC.

Answers (0)