ActiveReports 6 Online Help
Export Troubleshooting
See Also Send comments on this topic.
ActiveReports 6 > ActiveReports User Guide > Troubleshooting > Export Troubleshooting

Glossary Item Box

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.

General Export Troubleshooting

ShowSpecified 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:

  1. Remove all ActiveReports 6 references from the project.
  2. Add the ActiveReports 6 references necessary to your project, making sure to use only references to assemblies from the latest build installed on your machine.

Excel Export Troubleshooting

ShowExtra 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.

ShowExtremely 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:

  • Maximum worksheet size: 65,536 rows by 256 columns 
  • Maximum column width: 255 characters
  • Maximum row height: 409 points
  • Maximum length of cell contents (text): 32,767 characters. Only 1,024 display in a cell; all 32,767 display in the formula bar.

Solution: Use the Export(document,filePath,pageRange) or Export(document,outputStream,pageRange) method to export ranges of pages into separate Excel documents.

ShowExport 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");

ShowThe 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:

  • Line control
  • Borders on controls with angled text
  • Shapes (other than filled rects)
  • Overlapping controls

Solution: Try to avoid using the above items in reports which will be exported to Excel.

HTML Export Troubleshooting

ShowInvalid 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=true

Would be changed to the following.

SortSample.aspx?RunReport=true f=temp.mht

ShowThe 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:

  • Line control
  • Control borders
  • Shapes (other than filled rects)
  • Overlapping controls

Solution: Try to avoid using the above items in reports which will be exported to HTML.

ShowExported 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.

PDF Export Troubleshooting

ShowBarcodes 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:

  1. Set Page Scaling to None.
  2. Clear Auto-Rotate and Center.

For Acrobat 5, clear the following options in the Print dialog:

  1. Shrink oversized pages to paper size
  2. Expand small pages to paper size
  3. Auto-rotate and center pages

ShowThe 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:

  1. On the production Web server, from the Start menu, choose All Programs, Administrative Tools, Internet Information Services.
  2. Right-click your Default Web Site and choose Properties.
  3. On the Home Directory tab, click the Configuration button.
  4. On the Mapping tab, check the Extension column to see whether .ArCacheItem appears there.
  5. If .ArCacheItem does not appear click the Add button.
  6. Browse to C:\WINDOWS\Microsoft.NET\Framework\v2.x.xxxx or C:\WINNT\Microsoft.NET\Framework\v2.x.xxxx (or v3.x.xxxx).
  7. Change Files of type: to Dynamic Link libraries (*.dll).
  8. Choose the aspnet_isapi.dll and click Open.
  9. In the Extension textbox type ".ArCacheItem".
  10. Click the Limit to: radio button and type "GET,HEAD,POST,DEBUG".
  11. Make sure that the "Script engine" checkbox is checked and the "Check that file exists" checkbox is not checked.
  12. Click OK.

ShowExport 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:\"

ShowThe 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.

ShowA 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.

ShowThe 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.

RTF Export Troubleshooting

ShowThe 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.

  • Line controls
  • Backcolor
  • Shape controls
  • Overlapping controls
  • Control borders (except for borders on the RichTextBox control, which are supported)
  • Angled text

Solution: Try to avoid using the above items in reports which will be exported to RTF.

Text Export Troubleshooting

ShowThe 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.

TIFF Export Troubleshooting

ShowThe 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.

ShowThe 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).

See Also

Related Sections
Troubleshooting

Concepts
Export Filters