I am using the Crystal Reports that comes with Visual Studio 2008
Here is my problem. I have a simple little command line utility that generates a single crystal report. It
- Connects to a database
- Gets a dataset out of a stored procedure. The dataset is always one table with one row.
- Sets the dataset as the report's DataSource
- Depending on command-line flags either prints to the default printer, emails, or saves the report as a pdf
The app is used something like this:
c:\> GenerateReport 1000 1345 1 [email protected] pdf=c:\temp\ print
Where the first 3 arguments specify parameters for the stored procedure and the other arguments are optional but tell the utility what to do with the report. Very simple stuff. Works great, and has been for some time.
Except that since upgrading crystal reports (from whichever version was with vs2003) its been a little wonky. ONLY on the production site and ONLY when the report is printed, several (but not all) of the fields on the report are left blank!
This is especially confounding because the report is instantiated only once and all the data on report is coming from the DataSet - I have no report parameter fields. And the dataset is fetched and set as the datasource only once at the application start. After that I am simply calling report.PrintToPrinter, report.Export, or report.ExportToStream on the same instance depending on whether I want to print, export or email respectively.
What this means is that if I run the utility with the print and email=me@mycompany options the email that I get and the report that is printed are from the EXACT SAME ReportClass instance. Yet the same values that are consistently missing when printed are visible when the report is emailed or saved to disk.
Even worse, I can take the exact same executable. Move it to my development computer, point the config file at the production database and it prints to my local printer with all the values filled in!
I'm really quite stumped as to how to investigate this further - it seems like something is going on inside of CrystalReports. Is there some sort of diagnostic mode or logging mode that I can turn on that might give me a clue how to fix this?