In Sage X3, we may come across a situation where we need to prevent printing of a report and we can achieve this using code.
Steps to follow :
To prevent printing of a report we need to create a specific processing script for the report and put the following code in the file.

The principle is that when you set GOK to 0, the report will not be printed. Of course, you have to substitute the dots after ‘If’ with the appropriate condition. For example, suppose that you print a report from the Deliveries function (GESSDH) and you want to print it only if the delivery is validated then you need to put specific conditions to prevent report printing.
This action is called just before the printing of the document by Crystal Report. Warning! This action is mandatory, if an initialization process is specified in the report dictionary. It is not called by the instruction Gosub but by the Call instruction. Two parameters are passed to it, NBPAR (number of parameters) and PARAMETRE (parameters grid).
It is used for other functionalities as well which are explained in below points:
- As mentioned, it is used for preventing report printing when GOK variable value is set to 0.
- To update the X3 tables (for e.g. print flags etc.)
- construct a work table in order that the data may be more easily used by par Crystal Report.
It has also been used as an entry point. It was developed for earlier versions of X3.
Entry point IMPRIME had been created for one of the initial X3 versions. It had to be called just before selecting the printer and made it possible to inhibit the printer entry if variable GPE was different from 0.
The parameters are stored in the PARAMETRE variable with the indices 1 to NBPAR. Each value is a string in the form of “parameter=value” without any other separator.
At this level, the report parameters may be used that are stored in the PARAMETRE (1.NBPAR) grid where NBPAR is the number of parameters A parameter is expressed in this grid in the form : parameter name = parameter value.
There is also DEFIMP entry point which is used to return printer name (destination code) by entering the IMPRIMANTE variable and, if a printer’s name is mandatory.
This entry point is called at the end of the subprogram used to determine a default printer (destination code) even though a printer cannot be found after the standard setup.
This subprogram is called by the AIMDEF action and is usually called in order to initialize the printer before printing a report.
There are also other entry points which are used in the same prospect for the report printing process. (e.g. ALIMETAT) So, this entry points along with other subprogram has various uses for printing reports and other functionalities in X3 as explained in the above blog.
This blog helps to understand how we can prevent report printing pro-grammatically. Beside that it can be used for other usage which are explained in the above points.
About Us
Greytrix – a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.
Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3, Sage Intacct, Sage 100, Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like Greytrix Business Manager, Sage CRM Project Manager, Sage CRM Resource Planner, Sage CRM Contract Manager, Sage CRM Event Manager, Sage CRM Budget Planner, Gmail Integration, Sage CRM Mobile Service Signature, Sage CRM CTI Framework.
Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.
For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.