SAP Knowledge Base Article - Public

1205565 - Exporting a Crystal Report to Excel format introduces extra columns

Symptom

An ASP application uses the Report Designer Component (RDC) to view reports. When a report is exported from the RDC viewer page to Excel format, extra columns are inserted into the resulting XLS file. How can the report be exported without the addition of extra columns?

Reproducing the Issue

  1. Create a Crystal Report
  2. Deploy ASP application to export report to Excel format.
  3. View report using the ASP application.
  4. Note extra columns displayed in report output.

Cause


Resolution

This issue can be resolved by modifying the exporting routine in the RDCrptserver11.asp page.
 
Steps to resolve the issue: 

  1. Locate the RDCrptserver11.asp page in your web application directory.
  2. Open the file for editing.
  3. Locate the section containing the statement:
    Case "CRXF_XLS" 
  4. Edit the section as follows:
    Case "CRXF_XLS"
    If CInt(exportType) = 10 Then
    ExportOptions.FormatType = CREFTEXCELDATAONLY
    Else
    ExportOptions.FormatType = CREFTEXCEL
    End If
    GetExportPageRange startPage, endPage
    'ExportOptions.ExcelUseConstantColumnWidth = FALSE
    'ExportOptions.ExcelConstantColumnWidth = 36
    'ExportOptions.ExcelAreaType = 4
    ExportOptions.ExcelMaintainColumnAlignment = TRUE
    ExportOptions.ExcelMaintainRelativeObjectPosition = FALSE
  5. Save the file.


After completing these steps, extra columns won't be added when exporting reports to Excel format from the application.

Keywords

Excel RDC RDCrptserver11.asp , 8454345 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2