How to prevent the printing of a report pro-grammatically

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.

Script Editor

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 Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, 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 caters to a wide range of Sage X3, a Sage Business Cloud Solution, offerings. Our unique GUMU™ integrations include Sage X3 for Sage CRMSalesforce.com, Dynamics 365 CRM and Magento eCommerce along with Implementation and Technical Support worldwide for Sage X3. Currently we are Sage X3 Implementation Partner in East Africa, Middle East, Australia, Asia, US, UK. We also offer best-in-class Sage X3 customization and development services, integrated applications such as POS | WMS | Payment Gateway | Shipping System | Business Intelligence | eCommerce and have developed add-ons such as Catch – Weight  and Letter of Credit and India Legislation for Sage X3 to Sage business partners, end users and Sage PSG worldwide.

Greytrix is a recognized Sage champion ISV Partner for GUMU™ Sage X3 – Sage CRM integration also listed on Sage Marketplace; GUMU™ integration for Sage X3 – Salesforce is a 5-star rated app listed on Salesforce AppExchange and GUMU™ integration for Dynamics 365 CRM – Sage ERP listed on Microsoft AppSource.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com, We will like to hear from you.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert