Wednesday, 31 December 2014

Specific server name used by sub-reports in Crystal Reports that running in a web application

We use .NET application and Crystal Reports plug-in to run Crystal Reports in the .NET web application. Recently, we discovered that one of the reports we built throws SQL column missing error while running in the web application. It is unusual as all our reports are built in the same way.

At the end, we figured out that it was due to the report uses sub-reports and all sub-reports require to be saved with . as the server name in the Crystal Reports file. So that when it runs from the web application, it would then work successfully. In addition, we found this is the only solution and it will fail even when replacing the . with localhost.

This is an unusual solution that we normally do not see. So I record this here for future references.

Wednesday, 24 December 2014

Crystal Reports do not export page headers in Microsoft Excel (Data Only) format

Recently, I found when using Crystal Report to output to Microsoft Excel (Data Only) format. The page headers are not exported in this format.

I have done some researches on the Internet and found the export of page headers to Microsoft Excel (Data Only) format is not supported.

I figured out that the only workaround to this (in my case) is to put all required page header content in report header. If they are required to be in multiple lines, we just need to create one report header for each line and put the related content in each report header. So the content will be displayed in multiple lines (rows) in the Microsoft Excel (Data Only) format.

Meanwhile, we need to make sure that the following two options are selected in Microsoft Excel (Data Only) Format Options in Crystal Report:

  • Export page header and page footer
  • Simplify page headers

This solution has fixed our internal reporting issue to Microsoft Excel (Date Only) format. Hope it will also benefit the others.