The script you are executing is taking longer than expected to run

14 January 2012

Issue Description

When printing a report using Forms Printer, a dialog appears with the message:

"The script you are executing is taking longer than expected to run".

This dialog will appear when the process of printing a report by the report engine takes longer than the script execution timeout, which is 10 seconds by default.


The dialog can appear for the following reasons:

The Crystal Report Is Not Generic

This is usually only an issue with a Crystal 9 (or greater) Runtime Engine.

If you find that Crystal reports printed from Forms Printer are taking significantly longer as each successive report is printed, then you should check that your Crystal reports have been designed as Generic. Generic reports are designed using a temporary ODBC DSN that will not exist at report runtime on the client machines. Using a temporary DSN when designing Crystal reports is explained futher in the Forms Printer User Guide.

We have found in a few cases that successive prints of a report will run faster (and not degrade) if you open the report in the Crystal Reports application and set the ODBC DSN for the report (and any sub reports), by using "Set Datasource Location", to a DSN that will not exist on the workstation when the report is eventually printed. Having a DSN defined in the report that does not exist at report runtime allows Forms Printer to use the Great Plains DSN at runtime.

We have found in several cases, involving Crystal 9 or greater components, that this process improves performance of the report.

Dynamics GP Has Been Upgraded But Crystal Report Has Not Been Verified With New Database Schema

If Dynamics GP has been upgraded, but a Crystal report has not been verified against the new database schema, Crystal may be slowed by trying to adapt to database changes due to the upgrade. After upgrading Dynamics GP, use the Verify Database menu item in the Crystal Reports application to verify each report against the new database schema.

Large Numbers Of Records In The SOP50200 Temporary Print Table 

By default, when printing with Forms Printer, these temporary user print sequence records in the SOP50200 table are not deleted. This aids in re-running reports, that depend upon them, from the Crystal Reports application, whilst developing reports. A Dex.ini setting on client workstations can be used to reduce the number of records in the SOP50200 table to only the last set of records printed by each user. This can speed up report SQL queries.

The Dex.ini setting in Forms Printer that can be used to cleanup the SOP50200 table after each SOP document print using Forms Printer is:


You may have to clean up existing records once manually using SQL (DELETE from SOP50200) after changing this setting. 

The SQL Query Is Inefficient

The SQL query executed by the report takes too long to complete because either the query statement is inefficient, or the volume of data being returned is large.

You can use Microsoft SQL Profiler to analyse and possibly optimize the SQL query being executed by the report.

Hardware Constraints

Check that the problem workstation is not low on memory or hard disk space.

Changing The Execution Timeout

To avoid getting the dialog, you can increase or disable the script execution timeout, which by default is 10 seconds.

This can be accomplished for a particular workstation by adding the ASIFPVBSTIMEOUT Dex.ini setting.

Note that this works only if you have Forms Printer 8.0 build 22 or greater.

To disable the timeout and inhibit the dialog completely, set the dex.ini setting to -1:


To increase the timeout to 30 seconds, set dex.ini setting to 30000 milliseconds:


Technical Background Information

The dialog is actually opened by the Windows Script Control which is used by Forms Printer to execute VBscript code. Forms Printer uses Vbscript to communicate with each report engine's API in order to request that a report be printed by the engine.


Site Map