If you run into an issue while using ActiveReports exports, you will probably find the solution within this section. Click any short description below to drop down the symptoms, cause, and solution.
Specified cast not valid exception
Symptoms: The "Specified Cast Is Not Valid" exception fires.
Cause: There is a mix of old and new dlls in the references.
Solution:
Extra columns in exported spreadsheet
Symptoms: Extra columns are showing up in the Excel export.
Cause: Controls don't have the same Top and Height properties. When the Excel export runs, it divides the report into rows and columns based on the borders of the controls, much like a grid. Controls that are not aligned across the report cause the Excel export to produce more columns to accommodate them.
Solution: Use the new SnapLines feature to help align the controls. To remedy the situation, set as many controls with the same Left property values and the same Top property values as you can, aligning them as if they were in a grid. This reduces the number of columns exported. Also, setting the RemoveVerticalSpace or UseCellMerging property to True, or setting the MinColumnWidth property equal to the width of the narrowest cell may help.
Extremely long reports do not export
Symptoms: Extremely long reports do not export to Excel.
Cause: The maximum number of rows which can be exported to MS Excel version 8.0 or higher is 65,536, while older versions of Excel (4.0, 5.0 and 7.0) had a limit of 16,384 rows.
Here are other specifications for Excel version 9.0 which may affect your export:
Solution: Use the Export(document,filePath,pageRange) or Export(document,outputStream,pageRange) method to export ranges of pages into separate Excel documents.
Export fails sporadically in memory stream
Symptoms: When using a memory stream, the Excel export sporadically fails.
Cause: Internet Explorer requires a "content-disposition" header in the response.
Solution: Use code like the following before creating the export.
Paste this code |
Copy Code |
---|---|
Response.ContentType = "application/x-msexcel"; Response.AddHeader("content-disposition","attachment; filename=MyXLS.XLS"); Response.AddHeader("content-disposition","inline;filename=MyXLS.xls"); |
The export does not look like the original
Symptoms: The exported Excel file does not look exactly like the original report.
Cause: The Excel export is not WYSIWYG. It does not support the following items:
Solution: Try to avoid using the above items in reports which will be exported to Excel.
Invalid syntax error
Symptoms: Internet Explorer displays "Invalid syntax error" on the title bar, "The page cannot be displayed" in the body and the URL is prepended with mhtml: in the address bar.
Cause: This is caused by Microsoft Hotfix Q330994. Microsoft addressed an Outlook security flaw that used the MHT extension and broke the streaming HTML functionality.
Solution: Append the mht extension to the file when you link to it. For example,
SortSample.aspx?RunReport=trueWould be changed to the following.
SortSample.aspx?RunReport=true f=temp.mht
The export does not look like the original
Symptoms: The exported HTML file does not look exactly like the original report.
Cause: The HTML export is not WYSIWYG. It does not support the following items:
Solution: Try to avoid using the above items in reports which will be exported to HTML.
Exported vertical text in the Textbox and Label controls does not look like the original
Symptoms: Vertical text in the Textbox and Label controls in the exported HTML file does not look like the original report.
Cause: The export of vertical text to HTML is supported just for the DynamicHtml output type and works with Microsoft Internet Explorer only.
Solution:Set the OutputType property of the HTMLExport object to DynamicHtml and use Microsoft Internet Explorer to open the exported HTML file.
Barcodes do not scan and margins expand
Symptoms: Barcodes in printed PDF exports do not scan and the page margins appear larger than the ones in the original report.
Cause: The Adobe Acrobat reader has a default setting in the Print dialog which tells it to scale down large pages. The reader views ActiveReports margins as part of the document, and renders them inside the new margins it creates. This is normally not noticeable unless barcodes are used or the PDF printout is held up next to a printout of the original report.
Solution:
For Acrobat 6, 7, or 8, change the following options in the Print dialog under Page Handling:
For Acrobat 5, clear the following options in the Print dialog:
The WebViewer shows blank PDF reports
Symptoms: In the WebViewer, reports render correctly with the HTML viewer type but they show up blank with the AcrobatReader viewer type on the production Web server.
Cause: .ArCacheItem is not set up in your IIS extension mappings. Visual Studio now has the built-in Cassini Web server, so this problem does not show up during testing. However, this still needs to be set up for production.
Solution:
Export fails in the FIPS-compliant environment if CacheToDisk is used
Symptoms: The "Object reference not set to an instance of an object" exception fires.
Cause: The IsolatedStorage class is not FIPS-compliant.
Solution:You should disable the CacheToDisk property or set the CacheToDiskLocation property, using the code like the following:
C# |
Copy Code |
---|---|
rptTest ar = new rptTest(); ar.Document.CacheToDisk = true; ar.Document.CacheToDiskLocation = "c:\\"; |
Visual Basic |
Copy Code |
---|---|
Dim ar As New rptTest() ar.Document.CacheToDisk = true ar.Document.CacheToDiskLocation = "c:\" |
The ArgumentOutOfRange exception occurs when using a custom font factory in an application that exports a report and runs it on Azure Fabric
Symptoms: The ArgumentOutOfRange exception occurs when using a custom font factory in an application that exports a report and runs it on Windows Azure Development Fabric.
Cause: Fonts files are not copied to the server at the application deployment.
Solution: You should set BuildAction to Content and Copy to Output Directory to Copy always for all Fonts in the project Fonts folder.
A configuration error occurs when deploying an application with a custom font factory in a Windows Azure project
Symptoms: A configuration error occurs when an application with a custom font factory is deployed in a Windows Azure project.
Cause: The ActiveReports.Web dll is not present in the project and some ActiveReports DLLs are not copied to the server at the application deployment.
Solution: Add the ActiveReports.Web dll to the project and ensure that CopyLocal is set to True for all ActiveReports DLLs in the project.
The ConfigurationErrorsException error occurs when exporting an application with a custom font factory in Azure worker role project
Symptoms: When exporting an application with a custom font factory in Azure worker role project, the ConfigurationErrorsException error occurs.
Cause: Azure worker role does not support a virtual path.
Solution: You should specify the absolute path to the Font folder as <AddFolder Path="Fonts" Recurse="true"/> in the font factory section of app.config file.
The export does not look like the original
Symptoms: The exported RTF file does not look exactly like the original report.
Cause: The RTF export is not WYSIWYG, and is based on WordPad rather than Word, so there are some limitations. The following items are not supported in the RTF export.
Solution: Try to avoid using the above items in reports which will be exported to RTF.
The export does not look like the original
Symptoms: The exported text file does not look exactly like the original report.
Cause: The text export is not WYSIWYG. It is limited to plain, unformatted text, or plain text with encoding for foreign language support.
Solution: Only use the Text export when the output can be plain text with no formatting.
The export is completely black
Symptoms: Reports exported to TIFF format with the RLE, CCITT3 or CCITT4 compression scheme are rendering black.
Cause: The sections in the reports have a BackColor and are not dithered.
Solution: Set the Dither property for the export object to True, or set the BackColor property of each section to Transparent.
The export has extra white space at the bottom of the page
Symptoms: Some reports are exported to TIFF with extra white space at the bottom of the page.
Cause: The default value for CompressionScheme is CCITT3. According to CCITT3 standards, the page size is 1728 x 2376 pixels and the resolution is 200 x 196 DPI, as required by some fax machines. If the page is smaller than this standard, then it is scaled up to CCITT3 standards, which can cause extra white space at the bottom.
Solution: To get an accurate page size, set the CompressionScheme to CompressionScheme.Rle (Run length encoding).