Hi,
Currently I'm building a .NET application that will update the report data source that has been deploy to CR server. The deployed report is retrieving data from text-based file.
The source data are in text files(.txt) instead of databases(SQL, Oracle)
Following are the lines of codes that I have start with:
boInnerPropertyBag.Add("Database Name", strSourcePath); //c:\temp\ReportSource.txt
boInnerPropertyBag.Add("Database Type", "Text");
//Set the attributes for the boMainPropertyBag
boMainPropertyBag.Add("Database DLL", "crdb_dao.dll");
boMainPropertyBag.Add("QE_DatabaseName", strSourcePath); //c:\temp\ReportSource.txt
boMainPropertyBag.Add("QE_DatabaseType", "Text");
//Add the QE_LogonProperties we set in the boInnerPropertyBag Object
boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
boMainPropertyBag.Add("QE_ServerDescription", strSourcePath); //c:\temp\ReportSource.txt
boMainPropertyBag.Add("QE_SQLDB", "False");
boMainPropertyBag.Add("SSO Enabled", "False");
ConnectionInfo newConnectionInfo = new ConnectionInfo();
newConnectionInfo.Attributes = boMainPropertyBag;
newConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindMetaData;
rptClientDoc.DatabaseController.ReplaceConnection(oldConnectionInfo, newConnectionInfo, null, CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB);
rptClientDoc.RowsetController.Refresh();
No error occur on ReplaceConnection but when it comes to the following code an error "Database logon failed":
PrintOutputController rasPrintOutputController;
CrystalDecisions.ReportAppServer.ReportDefModel.CrReportExportFormatEnum rasReportExportFormat;
rasReportExportFormat = CrystalDecisions.ReportAppServer.ReportDefModel.CrReportExportFormatEnum.crReportExportFormatPDF;
rasPrintOutputController = rptClientDoc.PrintOutputController;
Byte[] myBytes = (rptClientDoc.PrintOutputController.Export(rasReportExportFormat, 0).ByteArray);
I can't seem to find sample where the data source is in text-based.
Am I setting the correct property details on the data source?