SAP Knowledge Base Article - Public

1302913 - custom paper size can not be retained at a client machine via ASP.NET application

Symptom

  • Custom paper size is lost at client side
  • Error : "Index was outside the bounds of the array."

Reproducing the Issue

  1. An ASP.NET application uses the Crystal Reports XI .NET SDK as the reporting development tool
  2. Create a custom paper size form for use in Crystal Reports on IIS machine. (Refer to Note 1214081: How to create a custom paper size form for use in Crystal Reports )
  3. Design a report using a custom paper size
  4. The report is displayed as expected in CrystalReportWebViewer via IE at any client machine
  5. Click EXPORT or PRINT on toolbar in CrystalReportWebViewer
  6. The custom paper size is lost or get "Index was outside the bounds of the array" error.

Cause

This is the expected behavior. Form ID of custom paper size rather than form name or width/height size is saved with the report file. However, form ID of custom paper size will not be same on every machine. Exception: Form ID of standard paper size (such as: LETTER, A4) is identical on all machines. Therefore, when the report is printed or exported on client machine via IE, it is impossible to pick up the same form ID so that the custom paper size is lost. 

Resolution

Workaround:

   EXPORTING:

  • Export the report into PDF or other format (except: RPT) at IIS Server side so it can still use and maintain the FORM ID of custom paper size on server machine (rather than client machine), then stream it back to client machine's browser.

           reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocument,Response, True, "test")

   PRINTING:

  • Use PDF printmode instead of ActiveX printmode of CrystalReportViewer. It can still use and maintain the FORM ID of custom paper size on server machine (rather than client machine).

            CrystalReportView1.PrintMode = CrystalDecisions.Web.PrintMode.Pdf

Keywords

custom, paper, size, print, export , KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports XI R2