on 05-28-2014 5:22 AM
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();
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
<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..
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
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
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
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.
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.
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.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.