This is an old revision of the document!


On the Print Events tab you can indicate which report has to be generated and printed on which event.

The list of print events is available here.

Pritn Events tab

5.1.6.1. Set up a print event

1. Select the necessary event in the Event drop-down menu.

2. Select the report to be generated upon the occurrence of the event in the Report drop-down menu.

3. Provide the number of copies to be printed in the Number of Copies field.

4. If you want the system to ask if more copies should be printed after the given number of copies has been printed, check in the Ask for Reprint? option.

5. Optional: In the Filter drop-down menu select a predefined filter, a condition that has to be met for the report to be generated.

The following filters can be selected:

a) Filter by Warehouse Move Matrix UDT(PRFWMM)
The filter can be used for warehouse move documents. It uses the settings of the Warehouse Move Matrix UDT to check whether a document should be printed.

b) Customer Collect (PRFCUCO) and Not for Customer Collect (PRFNCUCO)

  • PRFCUCO: The document is not printed for customer collects.
  • PRFNCUCO: The document is only printed for customer collects.

These filters can be used for the following print events:

  • 200 Picking: new LU full
  • 300 Shipping: sales delivery note created
  • 302 Shipping: picklist shipped
  • 500 Packing: finished LU

c) LUID Generated Printed (PRFLUIDG)
When a logistic unit is received with a valid logistic label containing an SSCC, the system does NOT generate a new reception label with a new system-generated SSCC. The filter can be used for the following print events:

  • 101 Reception new LU identified
  • 200 Picking: new LU full
  • 400 Production: LU produced
  • 500 Packing: finished LU
  • 700 WHS: created LU
  • 702 WHS: created master LU

d) Script (PRFSCRIP)
It offers the possibility to develop criteria for determining when and how a label should be printed. Please see section 5.1.6.2. Scripted print filters below.

6. Click Add.  

5.1.6.2. Scripted print filters

It is possible to define a custom print filter. It will allow to block printing for certain parameters.

A typical print filter consists of 3 main sections

  • Running of SELECT QUERY to get needed info for document
  • Determination of TRUE or FALSE value according to needed info
  • Return RESULT

Creation of a new print filter
In the Produmex Organizational Structure, go to the Print Events tab:

Here you can add a filter to the desired print event.
Select Filter → IPrintReportFilter – Script (PRFSCRIPT)
Then select the ‘Edit’ button.

The following script editor opens, here we will paste our script.

Press the ‘Empty script’ button to open a script template designed for the selected print event. We recommend to use this template instead of starting from an empty script.

The template contains two print report methods.

  • Use the first method if the report has only one parameter.
  • Use the second method if the report has more than one parameters.

Here you can find a demonstration script that explains what is needed.

using System;
using System.Reflection;
using Produmex.Foundation.Data.Sbo;
using Produmex.Foundation.Diagnostics;
using Produmex.Sbo.Logex.Data.BusinessObjects;
using Produmex.Sbo.Logex.Data.Providers;
using Produmex.Foundation.Data.Sbo.BusinessObjects;
using Produmex.Foundation.Data.Sbo.Utilities;
using Produmex.Foundation.Data.SqlClient;

public class Script
{
    private static readonly ILog s_log = 
			LogProvider.GetLogger(MethodInfo.GetCurrentMethod().DeclaringType);

    public static bool PrintReport(PmxPrintReportEventType eventType, int key, PmxDbConnection dbConn)
    {
        //Create the query you want to use
        string query = "SELECT [COLUMNAME1], [COLUMNAME2] FROM [TABLENAME] WHERE [Key] = " 
+ key.ToString();

        //Run the query
        using (ISboRecordset rs = SboRecordsetHelper.RunQuery(s_log, query, dbConn))
        {
            if (!rs.EoF)//Check if you get result from the query
            {
                string var1 = rs.GetTypedValue<string>("COLUMNAME");//Get a string value
                int var2 = rs.GetTypedValue<int>("COLUMNAME2");//Get an int value

                //Possibility to add a check on the result
                //In this case if the value of column with name 'COLUMNAME2' equals to 99, 
                //a label should be printed
                if (var2 == 99)
                {
                    return true; //Label will be printed
                }
                else
                {
                    return false; //Label will not be printed
                }
            }
        }
        return false; //Label will not be printed
    }
}

So you can modify this script to fit your needs:

  • Modify the query to lookup the needed info
  • Get the needed values from the query result
  • Modify the check on the result and return the correct TRUE or FALSE

Validate and test

You can also use this screen to:

  • Validate the Script
  • Do a test run with a KEY from the database :
    The key is what is passed to the report. So for the print event ProductionLogisticUnitProduced this is the LUID of the produced pallet.

In order to avoid performance issues, do not use ‘SELECT *’ syntax in the select query. Select only the required columns or the primary key.
Example:

  1. What should be avoided:
    SELECT * FROM "OITM" WHERE "ItemCode" = 'ITEM01'
  2. What to use instead:
    • SELECT "InvntItem", "MinLevel" FROM "OITM" WHERE "ItemCode" = 'ITEM01' 
    • SELECT "ItemCode" FROM "OITM" WHERE "ItemCode" = 'ITEM01'

It’s also recommended to add the WITH (NOLOCK) hint to all tables used in these queries.
For example:

  • SELECT "ItemCode" FROM "OITM" WITH (NOLOCK) WHERE "ItemCode" = 'ITEM01'
  • Or with a join (NOLOCK on all tables):
    SELECT "OITM"."InvntItem" FROM "DLN1" WITH (NOLOCK) JOIN "OITM" WITH (NOLOCK) ON "DLN1"."ItemCode" = "OITM"."ItemCode" WHERE "DLN1"."ItemCode" = 'ITEM01' 

This topic does not exist yet

You've followed a link to a topic that doesn't exist yet. If permissions allow, you may create it by clicking on Create this page.