Hello,
There is the following code in my .NET project:
ReportDocument MyReportDocument = new ReportDocument(); MyReportDocument.Load(@"C:\MyReport.rpt"); MyReportDocument.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; MyReportDocument.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; DiskFileDestinationOptions diskOpts = ExportOptions.CreateDiskFileDestinationOptions(); diskOpts.DiskFileName = @"C:\ExportedReport.pdf"; MyReportDocument.ExportOptions.ExportDestinationOptions = diskOpts; SetConnectionInfo(MyReportDocument); if (MyReportDocument.Rows.Count > 0) { MyReportDocument.Export(); } MyReportDocument.Close(); MyReportDocument.Dispose();
The following line throws the System.Data.EvaluateException: Cannot find column \[LOAD].:
if (MyReportDocument.Rows.Count > 0)
There is no "LOAD" column in my database tables and in my report.
Everything works fine when I comment this line.
I call this property to determine if any data is loaded.
I use Crystal Reports XI R2
So I have the questions:
-
1. What should I do to avoid this error?
2. Is there any alternate method or property?
I know that there is ReportDocument.HasRecords property in Crystal Reports 2008, but this property doesn't exist in Crystal Reports XI R2 version.
How can I determine if any data is loaded for XI R2 version?
-
Thank you.