Q: I have another question in the Detlef project. This customer has 4 different companies (Detlef, Thomas, Tim, Sutter) they want to print 3 different documents per company (INVOICE, LETTER, RECEIPT) Each document have a trigger (#F1#,#C1#,#R1#) But we have not a trigger per company, so we configure 4 printers sections, one per company.

The problem is that per document we have a different form (a special header), fonts and lines configuration, so I put the command in different ini files, but the ini file command does not work when you use it 2 times:

; CONVERT.INI

 

[Detlef]

IniFile=#ELP_FORMS_PATH#Detlef.ini

; Detlef.INI

[INVOICE_Detlef]

TRIGGER_Binary=#F1#
IniFile=#ELP_FORMS_PATH#FACDetlef.ini

; FACDetlef.INI ; WELP does not enter in this ini file

[FACTURA_Detlef]

ELP_COMMAND=C1H8F8000;
Search_Binary=#F1#
ERASE_BINARY=1

; HERE ADD FORMS, FONT, LINES....

Could you please help me?


A: Dear friend,

In your example I assume that Detlef is the name of the printer you used for printing all documents of the company Detlef. Using the IniFile key ELP automatically calls on process start the stag.ini file which is fine.

In that main ini file you use the TRIGGER_Binary command which is performed AFTER all data is read, so actually the FACDetlef.INI file is called, but there the search_binary is never performed, as search keys are performed through reading data in. This is the reason why it is not working. See Rules theory, how to trigger them

If you would have only to put some forms on the page, then you could have done it all with only one IniFile:

[Global]

...

[Detlef]

; Define using Variables which Forms should be used for company stag
; By setting them in the section of the STAG printer name

Variable=#InvoiceForm#:1000
Variable=#LetterForm#:1001
Variable=#ReceiptForm#:1002

[Thomas]

Variable=#InvoiceForm#:1100
Variable=#LetterForm#:1101
Variable=#ReceiptForm#:1102

[Tim]

Variable=#InvoiceForm#:1200
Variable=#LetterForm#:1201
Variable=#ReceiptForm#:1202

[Sutter]

Variable=#InvoiceForm#:1300
Variable=#LetterForm#:1301
Variable=#ReceiptForm#:1302

 

; Here are the search keys, which are analyzed after the initalizations above.

[Search for Invoice Form]

; Search for your info in the data stream which form is requested

Search_Binary_New=#F1#

; Delete the trigger

Erase_Binary=ON

; Set the ELP command using the above company set form variable

ELP_COMMAND=C1H1#InvoiceForm#

[Search for Letter Form]

Search_Binary_New=#C1#
Erase_Binary=1
ELP_COMMAND=C1H1#LetterForm#

[Search for Receipt Form]

Search_Binary_New=#R1#
Erase_Binary=1
ELP_COMMAND=C1H1#ReceiptForm#

; So far so good. This was just for a initial explanation. Looking at your provided files, I see, that you further manipulate the data stream depending upon the kind of form, using different searches.

Normally you could now put the form native ini file call into each form section, like:

[Search for Letter Form]

Search_Binary=#C1#
Erase_Binary=ON
ELP_COMMAND=C1H1#LetterForm#

IniFile=#ELP_FORMS_PATH#Letter.ini