ActiveReports 13
Troubleshooting
ActiveReports 13 > ActiveReports User Guide > Troubleshooting

If you run into an issue while using ActiveReports, you will probably find the solution within this section. Click any short description below to drop down the symptoms, cause, and solution. Or click a link to another section of the troubleshooting guide.

General Troubleshooting

Report menu does not appear in the main menu of Visual Studio 2019

Symptoms: When a report is opened in Visual Studio 2019, Report menu does not appear in the main menu.

Cause: Due to new behavior relating to extensions in Visual Studio 2019, Report menu is removed as main menu.

Solution: Go to Extensions menu. You can see that the Report menu is available as submenu.

References missing from Visual Studio Add Reference dialog

Symptoms: When you try to add references to your project, only a few of the ActiveReports references are available.

Cause: The project's target framework is set to an old version of the .NET framework that does not support the new assemblies.

Solution:

  1. In the Solution Explorer, right click the project and choose Properties.
  2. On the Application tab in C# projects (or the Compile tab, then the Advanced Compile Options button in Visual Basic projects), drop down the Target framework box and select .NET Framework 4.0.

Errors after installing a new build

Symptoms: When you open a project created with a previous build of ActiveReports after installing a new build, there are errors related to being unable to find the previous build.

Cause: Visual Studio has a property on references called Specific Version. If this property is set to True, the project looks for the specific version that you had installed when you created the report, and throws errors when it cannot find it.

Solution: For each of the ActiveReports references in the Solution Explorer, select the reference and change the Specific Version property to False in the Properties Window.

The project does not work if Integrated Managed Pipeline Mode is enabled

Symptoms: The web project does not work in the application pool if Integrated Managed Pipeline Mode is enabled.

Cause: The application configuration is incorrect for being used in Integrated mode.

Solution: Migrate the application configuration. Here is a sample command.

Paste the following on the command line.
Copy Code
"%SystemRoot%\system32\inetsrv\appcmd migrate config YourWebSite/"

GrapeCity.ActiveReports.Interop64.dll is not available in the default "Add Reference" dialog

Symptoms: The GrapeCity.ActiveReports.Interop64.dll is not available in the default "Add Reference" dialog.

Cause: The GrapeCity.ActiveReports.Interop64.dll is located in the distribution folder.

Solution: The GrapeCity.ActiveReports.Interop64.dll is located in C:\Program Files (x86)\Common Files\GrapeCity\ActiveReports 13\redist.

GrapeCity.ActiveReports.Extensiblity.dll is added to the list of unused dlls in Visual Studio

Symptoms: GrapeCity.ActiveReports.Extensiblity.dll is added to the references folder when the viewer is dragged and dropped on the form, however it is present in the list of unused dll in Visual Studio.

Cause: GrapeCity.ActiveReports.Extensiblity.dll is used internally for certain features in ActiveReports and is present in the Global Assembly Cache. Therefore, Visual Studio can resolve the dependency and cannot find the direct references due to which it gets listed as a unused dll in Visual Studio.

Reports are not associated with the designer in Visual Studio when adding ActiveReports to a TFS-bound project

Symptoms: When adding ActiveReports to a Web site project that is bound to TFS (where reports are added to the App_Code folder), the report does not open in the designer in Visual Studio.

Cause: The FileAttributes.xml file that contains attribute information to associate ActiveReports files with the Designer is usually loaded and maintained in memory when a new ActiveReports file is added. However, if a Web site is bound to TFS, the FileAttributes.xml file is not maintained in memory. As a result, Visual Studio treats all the newly added files as normal code files.

Solution: Add the newly added reports to FileAttributes.xml manually.

  1. From the Website menu, select Add New Item.
  2. Select ActiveReports 13 Section Report (code-based) and click OK.
  3. Close the project.
  4. From Windows Explorer, open the FileAttributes.xml file in an editor and add the new ActiveReports file, setting the subtype to Component, using code like the following.

    Note: The FileAttributes.xml is located at C:\Documents and Settings\[username]\Local Settings\Application Data\Microsoft\WebsiteCache\[WebSite1]\ (Windows XP), or at C:\Users\[username]\AppData\Local\Microsoft\WebsiteCache\[WebSite1]\ (Windows 7).

    XML code. Paste inside FileAttributes.xml
    Copy Code
    <?xml version="1.0" encoding="utf-16" ?>
    <DesignTimeData>
       <File RelativeUrl="App_Code/NewActiveReport1.cs" subtype="Component" />
       <File RelativeUrl="Default.aspx.cs" subtype="ASPXCodeBehind" codebehindowner="Default.aspx" />
       <File RelativeUrl="Default.aspx" subtype="ASPXCodeBehind" />                       
    </DesignTimeData>
    
  5. Save the FileAttributes.xml file.
  6. Reopen the Web site project.

The SystemNotSupportedException occurs when running ActiveReports with scripts on .NET Framework 4.0

Symptoms: The SystemNotSupportedException occurs when running ActiveReports with scripts on .NET Framework 4.0.

Cause: This exception occurs because of the CAS policy, which is obsolete in the .NET Framework 4.0.

Solution: To resolve this issue, the configuration file needs to be updated. To do this, in the Solution Explorer, open the app.config file (for Windows Forms applications) or the Web.config file (for ASP.NET Web applications) and add the following code.

(Windows Forms Applications) XML code. Paste inside the app.config file
Copy Code
<configuration>
  <runtime>
    <NetFx40_LegacySecurityPolicy enabled="true"/>
  </runtime>
</configuration>
(ASP.NET Web Applications) XML code. Paste inside the Web.config file
Copy Code
<system.web>
   <trust legacyCasModel="true"/>
</system.web>

Microsoft Access OLE DB provider in a 64-bit system

Symptoms: Microsoft Access OLE DB provider, Microsoft.Jet.OLEDB.4.0 does not work on a 64-bit system.

Cause: In Visual Studio 2010, by default, projects are set to use 32 bit or 64 bit, depending on the environment on which they are run. The Microsoft Access OLE DB provider, Microsoft.Jet.OLEDB.4.0, is not compatible with 64 bit, so it fails with Visual Studio 2010 on a 64-bit system.

Solution: To avoid this situation, change the project settings to use only 32 bit.

  1. With the project open in Visual Studio, from the Project menu, select Project Properties.
  2. In the page that appears, select the Compile tab in a VB project, or the Build tab in a C# project.
  3. Scroll to the bottom of the page and click the Advanced Compile Options button in VB, or skip this step in C#.
  4. Drop down the Target CPU list in VB, or Platform target in C#, (set to use AnyCPU by default) and select x86.
  5. Click OK to save the changes, or skip this step in C#.

The printing thread dies before the report finishes printing

Symptoms: The printing thread dies before the report is printed.

Cause: If printing is done in a separate thread and the application is shut down right after the print call, the separate thread dies before the report is printed.

Solution: Set the usePrintingThread parameter of the Print() method to False to keep the printing on the same thread. This applies to all Page reports, RDL reports and Section reports.

  1. In the project where you call the Print method, add a reference to the GrapeCity.ActiveReports.Viewer.Win assembly.
  2. At the top of the code file where you call the Print method, add a using directive (Imports for VB) for GrapeCity.ActiveReports.
  3. Call the Print method with the usePrintingThread parameter (the third parameter) set to false with code like the following.
C# code.
Copy Code
document.Print(false, false, false);
Visual Basic code.
Copy Code
document.Print(False, False, False)

Exception thrown when using Viewer.Print to print a report

Symptoms: An exception is thrown when the Viewer.Print method is used to print a report.

Cause: Print method was called before the page was loaded completely.

Solution: Use the Viewer.Print method in the LoadCompleted event.

ActiveReports controls do not appear in the toolbox

Symptoms: ActiveReport controls do not appear in the toolbox even when they are added manually using the steps in Adding ActiveReports Controls.

Cause: The project is using .NET 2.0 or lower.

Solution: Confirm if the project is using .NET 3.5 or higher. ActiveReports does not support .NET 2.0.

Error on previewing Server reports

Symptoms: When you try to preview Server reports created in previous ActiveReports versions in ActiveReports 13 designer, error 'Server report is not supported' occurs.

Cause: The Server credentials are present in report definition and ActiveReports Server is not supported in ActiveReports 13.

Solution: Edit the report in any text editor and remove the <Custom Property> tag that contains the Server name and URL.

Error on rebuilding some ActiveReports samples in Visual Studio 2012 on .NET Framework 4.7 or higher

Symptoms: When you try to rebuild some ActiveReports samples in Visual Studio 2012 on .NET. Framework 4.7 or higher, compilation errors occur.

Cause: The default target framework version of the sample is 4.6.2.

Solution: In the App.config file of the project, drop the binding by removing <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.0.0.0" /> for the System.IO.Compression assembly.

Section Report Troubleshooting

Blank pages printed between pages, or a red line appears in the viewer

Symptoms: Blank pages are printed between pages of the report.

Cause: This problem occurs when the PrintWidth plus the left and right margins exceeds the paper width. For example, if the paper size were set to A4, the PrintWidth plus the left and right margins cannot exceed 8.27"; otherwise blank pages will be printed. At run time, ActiveReports marks a page overflow by displaying a red line in the viewer at the position in which the breach has occurred.

Solution: Adjust the PrintWidth in the report designer using either the property grid or by dragging the right edge of the report. Adjust page margins, height, and width either through the print properties dialog box (in the Report menu under Settings), or programmatically in the Report_Start event.

Copying reports results in stacked controls

Symptoms: A report file copied into a new project has all of its controls piled up at location 0, 0.

Cause: The report has become disconnected from its resource file. When you set a report"s Localizable property to True, the Size and Location properties of the report"s controls are moved to the associated *.resx file, so if you copy or move the report, you must move the *.resx file along with it.

Solution: When you copy a report"s *.vb or *.cs file from one project's App_Code folder into the App_Code folder of a new project, you need to also copy its *.resx file from the original project"s App_GlobalResources folder into the new project's App_GlobalResources folder.

No data appears in a report containing the OleObject control

Symptoms: No data appears in a report containing the OleObject control.

Cause: This issue occurs when the Microsoft .NET Framework 4.5.2 or above is used and the useLegacyV2RuntimeActivationPolicy attribute is not set to True.

Solution: Open the app.config file and set the useLegacyV2RuntimeActivationPolicy attribute to true.

XML code. Paste INSIDE the app.config file.
Copy Code
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="MyRunTimeVersion"/>
</startup>
</configuration>

An error message appears in the Fields list

Symptoms: An error message is displayed in the Fields list in the Report Explorer instead of the fields.

Cause: This is an expected error if no default value is given for a parameter. If the field is a data type other than text, memo, or date/time in Access, the report still runs normally.

Solution: To display the fields in the Fields list in the Report Explorer, supply a default value for the parameter in the Properties Window, or in the SQL query as below:

SQL Query
Copy Code
<%Name | PromptString | DefaultValue | DataType | PromptUser%>

Only the Name parameter is required. To use some, but not all, of the optional parameters, use all of the separator characters but with no text between one and the next for unused parameters. For example:

SQL Query
Copy Code
<%Name | | DefaultValue | |%>

An unhandled exception of type "System.Data..." occurs when the report is run

Symptoms: When the report is run, an exception like the following occurs: "An unhandled exception of type "System.Data.OleDb.OleDbException" occurred in system.data.dll"

Cause: If the field is a text, memo, or date/time data type in Access, the parameter syntax requires single quotes for text or memo fields, or pound signs for date/time fields. Please note that for different data sources, these requirements may differ.

Solution: To avoid the exception when the report is run against an Access database, use pound signs for date/time values, or single quotes for string values in your SQL query, for example:

SQL Query
Copy Code
#<%InvoiceDate | Choose invoice date: | 11/2/04 | D | True%>#

or

SQL Query
Copy Code
"<%Country | Country: | Germany | S | True%>"

User is prompted for parameters for subreports even though they are supplied by the main report

Symptoms: The parameter user interface pops up at run time asking for a value even though the main report is supplying the parameter values for the subreports.

Cause: The default value of the ShowParameterUI property of the report is True.

Solution: Set the ShowParameterUI property of the report to False. This can be done in the property grid or in code in the ReportStart event.

The viewer shows the report on the wrong paper size

Symptoms: In the viewer, the report renders to a different paper size than the one specified.

Cause: ActiveReports polls the printer driver assigned to the report to check for clipping, margins, and paper sizes supported by the printer. If the paper size specified for the report is not supported by the printer, ActiveReports uses the printer's default paper size to render the report.

Solution: If the report is to be printed, the printer assigned to the report must support the paper size and margins. Please note that any changes to the print settings in code must be made in or before the ReportStart event. To use custom paper sizes not supported by the driver, set the PrinterName to an empty string to use the ActiveReports virtual print driver. This does not allow printing, but is recommended for reports that are only exported or viewed. This prevents ActiveReports from making a call to the default printer driver. Use the following code in the ReportStart event, or just before .Run is called.

C# code. Paste INSIDE the ReportStart event.
Copy Code
this.Document.Printer.PrinterName = '';
Visual Basic.NET code. Paste INSIDE the ReportStart event.
Copy Code
Me.Document.Printer.PrinterName = ''

The PaperHeight and PaperWidth properties, which take a float value defined in inches, have no effect unless you set the PaperKind property to Custom. Here is some sample code which can be placed in the ReportStart event, or just before .Run.

C# code. Paste INSIDE the ReportStart event.
Copy Code
this.PageSettings.PaperKind = Drawing.Printing.PaperKind.Custom;
this.PageSettings.PaperHeight = 2; 
//sets the height to two inches 
this.PageSettings.PaperWidth = 4; 
//sets the width to four inches
Visual Basic.NET code. Paste INSIDE the ReportStart event.
Copy Code
Me.PageSettings.PaperKind = Drawing.Printing.PaperKind.Custom 
Me.PageSettings.PaperHeight = 2 
'sets the height to two inches 
Me.PageSettings.PaperWidth = 4 
'sets the width to four inches

Custom paper sizes do not work

Symptoms: Custom paper sizes do not work.

Cause: You can create more than one custom paper size, so setting only the PaperKind property is not enough to create a custom paper size.

Solution: In addition to setting the PaperKind property to Custom, you must also set the PaperName property to a unique string.

Page/RDL Report Troubleshooting

An expression containing a numeric field name does not display any data at run time.

Symptoms: An expression containing a numeric field name does not display any data at runtime.

Cause: Visual Basic syntax does not allow an identifier that begins with a number.

i.e. =Fields!2004.Value

Solution: Make the numeric field name a string.

i.e. =Fields("2004").Value or, =Fields.Item("2004").Value

DataSet field in PageHeader of an RDL report

Symptoms: Cannot set a dataset field (bound field) in the PageHeader of an RDL report.

Cause: ActiveReports is based on the RDL 2005 specifications, therefore, referencing datasets in the PageHeader of an RDL report is not supported.

Solution: There is no direct way to add a DataField in a PageHeader, however, as a workaround you can create a hidden report parameter that is bound to your dataset and has the default value set to your expression. For example, ="*" & First(Fields!name.Value). You can then use this parameter in the page header.
Alternatively, you can use a Page report, which lets you place data fields anywhere on a page.

Exception thrown when using Viewer.Document property

Symptoms: An exception is raised when Viewer.Document is used with a page report or RDL report.

Cause: Document property is available for section reports only.

Cannot add assembly reference created in .NET Framework 4.0 or above in PageReports/RDLReports

Symptoms: Cannot add assembly reference created in .NET Framework 4.0 or above in PageReports/RDLReports of the stand-alone designer application.

Cause: The Stand-alone Designer application was created using the .NET 3.5 framework, therefore it cannot load .NET 4.0 assemblies.

WPF Viewer Troubleshooting

TargetInvocationException occurs when running the WPF browser application

Symptoms: When running the WPF browser application, the TargetInvocationException occurs.

Cause: The WPF browser application does not support Partial Trust.

Solution: Make sure that the WPF browser application uses Full Trust. To do that, in the Visual Studio Project menu, go to YourProject Properties and on the Security tab, under EnableClickOnce security settings, select the option This is a full trust application.

Memory Troubleshooting

Note: According to Microsoft it is not necessary to call GC.Collect and it should be avoided. However, if calling GC.Collect reduces the memory leak, then this indicates that it is not a leak after all. A leak in managed code is caused by holding a reference to an object indefinitely. If ActiveReports is holding a reference to an object, then the object cannot be collected by the garbage collector.

Symptoms: ActiveReports is consuming too much memory; CPU usage always goes to 100% when using ActiveReports.

Cause: There are several reasons why too much memory may be consumed:

The report is not being disposed of properly

Cause: The report is not being disposed of properly. The incorrect syntax is as follows.

C# code.
Copy Code
//Incorrect!                
rpt.Dispose();
rpt=null;
Visual Basic code.
Copy Code
'Incorrect!
rpt.Dispose()
rpt=Nothing

Solution: The correct syntax for disposing of a section report is as follows.

C# code.
Copy Code
//Correct!
rpt.Document.Dispose();
rpt.Dispose();
rpt=null;
Visual Basic code.
Copy Code
'Correct!
rpt.Document.Dispose()
rpt.Dispose()
rpt=Nothing

Machine.Config MemoryLimit setting is insufficient

Cause: Large reports in an ASP.NET application can easily use up the 60% of memory allocated to the ASP.NET worker process by default, which produces an error. In Machine.Config, MemoryLimit specifies the maximum allowed memory size, as a percentage of total system memory, that the worker process can consume before ASP.NET launches a new process and reassigns existing requests.

Solution: Set the CacheToDisk property of the document to True.

This caches the report to disk instead of holding it in memory. This setting is also detected by the PDF Export, which follows suit, but any other exports still consume memory. Although it is not advised, the ASP.NET worker process memory allocation can also be changed in your Machine.Config file, which is located in a path like: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\. Search the Machine.Config file for memoryLimit, which is located in the processModel.

Report never finishes processing

Cause: In some cases, very large reports can consume so much memory that the report never finishes processing. Some of the things that can cause this include:

  1. Many non-repeating images, or a high resolution repeating image
  2. Instantiating a new instance of a subreport each time the format event of a section fires
  3. Using a lot of subreports instead of grouping with joins in the SQL query
  4. Pulling in all of the data when only a few fields are needed (e.g. Select * from db instead of Select First, Last, Address from db)

Solution: In cases where the report is too large to run any other way, the CacheToDisk property may be set to True. This property should only be used when there is no other way to run the report to completion. Before resorting to this method, please see the Optimizing Section Reports topic.

Task manager indicates the current "working set" of the process

Cause: If inflated memory usage is seen in the Task Manager it is not necessarily in use by the code. Task manager indicates the current "working set" of the process and, upon request, other processes can gain access to that memory. It is managed by the Operating System.

Solution: For an example of some working set behavior anomalies (which are considered normal), create a WinForms application and run it. Look in Task Manager at the working set for that process (it should be several megabytes), then minimize and maximize the form and notice that the working set reclaims to <1MB. Obviously, the code was not using all that memory even though Task Manager showed that it was allocated to that process. Similarly, you'll see ASP.NET and other managed service processes continue to gradually grow their working set even though the managed code in that process is not using all of it. To see whether this is the case, try using the two lines of code below in a button Click event after running the project.

System.Diagnostics.Process pc = System.Diagnostics.Process.GetCurrentProcess();
pc.MaxWorkingSet = pc.MinWorkingSet;

If that reclaims the memory then the Operating System trimmed the working set down to the minimum amount necessary and this indicates that the extra memory was not actually in use.

WebViewer Troubleshooting

The WebViewer will not print without displaying the report

Symptoms: The WebViewer will not automatically print a report without displaying it.

Cause: Only the new FlashViewer ViewerType of the WebViewer offers this functionality.

Solution:

  1. Set the ViewerType property to FlashViewer.
  2. Expand the FlashViewerOptions property, and expand the PrintOptions subproperty.
  3. Under the PrintOptions subproperty, set the StartPrint property to True.

PDF opens in a new window when an application contains the WebViewer

Symptoms: When using Internet Explorer and Acrobat Reader to view a page containing a WebViewer in PDF mode, the resulting PDF always opens in a new window.

Cause: Acrobat Reader is only available in a 32-bit version. When the 64-bit version of Internet Explorer is used, it opens up an instance of the 32-bit version of Internet Explorer so that the plug-in and the PDF can load, rendering the resulting PDF in a new window.

Solution:

The report in the HTML viewer type does not look exactly like the other viewer types

Symptoms: The report in the HTML viewer type does not look exactly like the other viewer types.

Cause: The HTML format is not WYSIWYG. It does not support the following items:

Solution: Try to avoid using the above items in reports which are shown in HTML format.

Blank reports with the AcrobatReader viewer type on the production web server

Symptoms: In the WebViewer, reports render correctly with the HTML ViewerType but they show up blank with the AcrobatReader ViewerType on the production web server.

Cause: .ArCacheItem is not set up in your IIS extension mappings.

Solution:

  1. From the Start menu, choose Control Panel, then Administrative Tools, then 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. If not, click Add.
  5. In the Add/Edit Application Extension Mapping dialog that appears, click Browse and navigate to (Windows)\Microsoft.NET\Framework\vx.0.
  6. In the Open dialog, change Files of type to Dynamic Link libraries (*.dll).
  7. Select aspnet_isapi.dll and click Open.
  8. In the Extension textbox type .ArCacheItem.
  9. Click the Limit to radio button and type GET,HEAD,POST,DEBUG.
  10. Ensure that the Script engine check box is selected and the Check that file exists check box is cleared.
  11. Click OK.

HTML5 Viewer Troubleshooting

Issue while previewing reports in HTML5 using redirection

Symptoms: When a url, such as an image path, a drill-through path, or a toggle path in a report points to an intranet location, the element specified in the url is not displayed properly.

Cause: One server can not access the paths specified from another server. For example, when HTML5 Viewer gets the report in HTML, the images use the img element and the src attribute of the image is built on the server side which uses default intranet url instead of the internet url.

Solution: Use HTML5 viewer together with reverse proxy or other redirection environment by specifying the following settings:

  1. Add the following line of code in index.html:
    Paste inside the index.html file
    Copy Code
    reportService: { url: 'http://reverse-proxy.com'; };
    

    See Using Javascript for more information.

  2. Specify publicURL setting in Web.config file as follows:
    XML code. Paste inside the Web.config file
    Copy Code
    <>
    <WebService publicURI="https://reverse-proxy.com"/>
    </>
    

    See ReportService Settings for more information.