What is the rule of printer?

13 Apr.,2024

 

Restricting Printer Usage

You can use the Printing rules to restrict the printer usage. For example, restrict what documents can be printed, warn users about large print jobs to reduce waste, etc.

1. Create an Activity rule.

2. Select Printing under the types of activities.

3. Select the users the rule will apply to.

4. Specify the detection conditions for the Number of pages.

5. Select an action to take when the rule is violated. In this example, we used a Warn action.

Detecting Printing Anomalies (On-Premise)

You can also detect printing anomalies using the Anomaly rules. For example, the following rule will detect when a user is printing more than the department’s baseline.

1. Create an anomaly rule.

2. Select the users the rule will apply to.

3. For the WHAT TRIGGERS THE RULE, select the Documents printed option.

4. For the rule’s condition, select Anomaly baseline.

5. Specify a risk level.

6. You can also specify a Notify action.

Defines the printer form (a list of printer settings) to be used.

Printer({ 'FormName' | att | &var });

Where:

FormName | att | &var 
      
Represent the printer's form name (i.e., ‘DefaultPrinter’). When using a variable or an attribute, it must be a Character data type.

Objects: Procedure
Generators: .NET, .NET Framework, Java, RPG, Cobol, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3), 

The printer rule is used to select a printing form. When using the iSeries generator, this rule specifies the printer file to be used in the iSeries.

For each printer rule defined in any report or procedure, a form is generated in a file called GXPRN.INI (located where the application is executed) with the default values taken from the report or procedure.

When the object containing the printer rule is executed, the INI file is opened and the selected form is read to get the associated printer setting; the object is printed using these parameters.

You can use the GxSetFrm utility to set the desired value for each form defined; check this article for further information.

The GXPRN.INI file must be located in the application virtual directory when using C# generator; for the Java generator locate it in the web application's WEB-INF directory.

The file is automatically created once the report or procedure object is executed (only if the file does not exist); the GeneXus design values are set.
If you want to modify the printer form settings, you have to:

  • stop the application.
  • modify the file manually.
  • restart the application.

GeneXus uses the General Purpose library (QGPL) QPRINT Printer File by default. The Printer rule allows you to use a different Printer File instead of the QPRINT file, so you can apply whatever options you wish.

The file used must satisfy the following requirements:

  • It must be a Program Defined File (Not DDS).
  • The name cannot have invalid COBOL characters (such as underscore, etc.)
  • The name's length cannot exceed 8 characters in RPG and 10 characters in COBOL.

The procedure suggested to define a Printer File is: copy the QPRINT file and then use the CHGPRTF (Change Printer File) command to set the desired options. 

Note: For each rule or set of rules, you can force them to be triggered _only_ for certain environment(s). See more details in the following document:

: For each rule or set of rules, you can force them to be triggered _only_ for certain environment(s). See more details in the following document: Form-specific Events and Rules

Printing with GeneXus
Client side printing in web applications
GXPRN.INI Format

       



What is the rule of printer?

Printer rule