- Custom paper size is lost at client side
- Error : "Index was outside the bounds of the array."
Reproducing the Issue
- An ASP.NET application uses the Crystal Reports XI .NET SDK as the reporting development tool
- 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 )
- Design a report using a custom paper size
- The report is displayed as expected in CrystalReportWebViewer via IE at any client machine
- Click EXPORT or PRINT on toolbar in CrystalReportWebViewer
- The custom paper size is lost or get "Index was outside the bounds of the array" error.
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.
- 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")
- 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
custom, paper, size, print, export , KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Problem