Symptom
- Reports based on legacy TTX files
- Using CRVS2010 SDK for VS 2010 to pass an ADO .NET dataset to the reports
- Using 32 bit application results in no errors
- Using a 64 bit application results in the error:
Logon Failed. Error in File xxx.rpt: Unable to connect: incorrect log on parameters
Environment
- VS2010
- CRVS2010
Cause
- Reports created off of TTX files looks for the file crdb_fielddef.dll
- When using a 32 bit application the file is located in the folder:
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86 folder
- There is no 64 bit crdb_fielddef.dll (C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64)
Resolution
- The report's database driver must be converted to crdb_adoplus.dll
- For sample code on how to use ReplaceConnetion() see the blog How to use reports based on multiple TTX files in Visual Studio .NET
Another solution is to simply load your data into a Dataset and then use the 3 lines blow to set the report data source to the Dataset.
Note: Datasets are limited to the amount of data used. Example below is also to simplify the dataset is filled from XSD structure file.
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXml(@"D:\Atest\906445\sc.xsd", XmlReadMode.ReadSchema);
rptClientDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(ds), "testCrystalData");
Update: R&D has reviewed this work around and will add a DataSetConverter property to the SetDataSource API so you do not need to convert it manually. Update to follow...
Keywords
CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 crystal reports for visual studio 2010 crforvs 13 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To