Printing LSPOS.Nettable of Contents 1. Introduction 3

Total Page:16

File Type:pdf, Size:1020Kb

Printing LSPOS.Nettable of Contents 1. Introduction 3

Printing LSPOS.NET

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 1/12 [email protected] Table of contents

1. Introduction...... 3 2. Printing fundamentals...... 3 3. Printing software...... 4 4. Troubleshooting the printing connection...... 5 5. The printing table structure...... 6 6. Creating forms...... 8 7. Configuring printing...... 9

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 2/12 [email protected] 1. Introduction The purpose of this document is to provide information about printing from the LSPOS.NET pos application.

2. Printing fundamentals Printers can be connected to the pos in two ways.  One way is directly to the computer via the computer’s communication ports (serial or USB). When printing via the local communication ports, the POS communcates entierly with an OPOS driver which provides the POS with all neccessary functionality.  The other way is to print to a network printer. By using this method, the printed material is sent to the printer spooler in the same way as a word processor would do. Therefore the POS has no possibility to receive any confirmation of any kind, i.e if the printing was successful. Should the printer be out of paper, the print jobs will just line up. Figure 1 depicts a typical printing environment where two printers are connected; an OPOS printer that the POS knows by the name of Epson1 and a network printer that goes by the name \\ServerName\PrinterName.

Epson1 \\ServerName\PrinterName

Figure 1 - Possible printing environment for a Pos

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 3/12 [email protected] 3. Printing software When communicating with an OPOS driver, two kinds of software must be installed on the system. One is the OPOS driver provided by the printer’s manifacturer (in this case the EPSON OPOS software). The other is a software called Curtis Monroe to insure functional compatibility. In many cases it has proven to be neccessary to install the Curtis Monroe software after the OPOS driver is installed.

Curtis OPOS Monroe Driver Compati- (NCR/ bility EPSON/ interface etc.) Epson1

Figure 2 - The OPOS communication diagram

When the OPOS driver has been installed, a registry entries are typically created for every device that the manufacturer supports. Even though the OPOS driver is installed, every device must be configured. This is done by configuring the OPOS communication settings according to how the printer expects them to be. The most common commuication settings are:  Baud rate. Common values for this is; 4800, 9600, 19200, 38400, 57600, or 115200.  Byte size. Can be either 7 or 8 bits.  Parity: Can be; Even, Odd, Mark, Space, or None  Port number: Which port number should the OPOS driver try to locate the printer. The OPOS driver manifacturer usually provide some kind of software to modify the driver’s settings, but in any case these settings can be modified be altering the registry. The standard path in the registry for this is HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail. The software lets you create a name for your device (like Epson1). Then you can give this name some parameters which will be saved in the registry.

Epson1 Port=com1 Baud=19200 Parity=None Byte=8 Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 4/12 [email protected] 4. Troubleshooting the printing connection If a locally connected printer does not work, the first thing to have in mind is the communcation port. The OPOS driver must be directed to the correct port where the printer is connected. No other software (including Windows) must be using this same port for any other purpose. Next thing to look for is; do all the serial communication parameters match? The printer itself is set to communicate using some settings, and we must make sure that the OPOS driver is set out to “speak the same language” as the printer by using identical settings. If no special test print software is provided, it can be useful to add a windows printer that uses a comport and print a testpage. 1. Add a local printer using Windows printer configuration. 2. Choose a correct port number 3. Choose a Generic / Text only printer 4. Right click the newly added printer – choose properties 5. Click the Ports tab and click Configure ports 6. Set the communication parameters 7. Click the General tab and click Print Test Page. 8. Remember to delete the printer when the test is over. For a network printer it is sufficent to try to print out a testpage using the standard Windows printing feature. 1. Add a network printer using Windows printer configuration. 2. Right click the newly added printer – choose properties. 3. On the General tab click Print Test Page. 4. Remember to delete the printer when the test is over.

Figure 3 shows a configuration where the OPOS driver is communicating in much higher speed than the printer is doing. Either the OPOS driver must lower it’s speed to 9600 or the printer must be able to be set to 19200 (Figure 4).

Com1

POS Printer OPOS Hardware Epson1 appli- Com=1 Com2 Driver interface Baud=9600 cation Baud=19200

Com5 USB

Figure 3 - A configuration where printing is impossible

Com1

POS Printer OPOS Hardware Epson1 appli- Com=1 Com2 Driver interface Baud=19200 cation Baud=19200

Com5 USB Landsteinar Strengur hf. Ármúla 7 Figure 4 - A configuration where printing is successful 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 5/12 [email protected] 5. The printing table structure

5.1. The basic tables

In order to be able to print, the Pos must be aware of the Printer’s name and also wheather it is allowed to print. The table POSHARDWAREPROFILE stores this information.

Pos.exe. TerminalId=0001 config StoreID=S0001 DataAreaID=dat

ROBTERMINALTABLE TerminalID HardwareProfile 0001 Epson

POSHARDWAREPROFILE ProfileID Printer PrinterDeviceName Epson 1 Epson1 Figure 5 - The basic table structure

Figure 5 shows the basic table structure, but these settings only apply to print forms that are not user-created, such as the customer balance. The Printer=1 in the POSHARDWAREPROFILE indicates that the printer is considered to be connected but the PrinterDeviceName is in this case the OPOS driver name (for example “Epson1”). If the printer is a network printer, then the Printer should be set to Printer=2. Then the PrinterDeviceName is the network path to the printer (for example “\\ServerName\Printername”).

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 6/12 [email protected] 5.2. The form layout table

The form layout table POSISFORMLAYOUT contains information about the different print layout. Each form can have specifications about wheather to print to the OPOS printer defined in the POSHARDWAREPROFILE table or print to the windows printer specified at the layout level.

The POSISFORMLAYOUT table has the following fields:

ID: A string that identifies the layout. Title: The title of the layout. Description: The description of the layout. UpperCase: Specifies wheather all the characters will be converted to uppercase before they are printed. LineCountPrPage: The line count pr page. HeaderXML: The xml layout of the header. LinesXML: The xml layout of the lines. FooterXML: The xml layout of the footer. PrintAsSlip: Specifies wheater the layout will be printed to the slip printer. UseWindowsPrinting: Specifies wheather the layout will be printed to a windows printer WindowsPrinter: The \\Servername\printername path to the windows printer.

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 7/12 [email protected] 6. Print commands There are some previously defined printing commands that the POS uses:

Operation name Print Description operation ID Receipt 1 The transaction receipt. CardReceiptForShop 2 The card receipt withheld by the shop CardReceiptForCust 3 The card receipt for the customer CardReceiptForShopReturn 4 Same as 2 but when returned CardReceiptForCustReturn 5 Same as 3 but when returned EFTMessage 6 A special receipt displaying the information provided by the EFT CustAcntReceiptForShop 7 Customer account receipt withheld by the shop CustAcntReceiptForCust 8 Customer account receipt for customer CustAcntReceiptForShopReturn 9 Same as 7 but with return CustAcntReceiptForCustReturn 10 Same as 8 but with return TenderDeclaration 11 The tender declaration form.

The Pos core can execute any of the printing commands listed above and it is up to the user to create a form layout for each of these commands. That is done by creating a layout and giving it a specifice layoutID. See section 7 for information about how to create a form layout. A special table is used to specify which operation is linked to which layoutID. See section 8 for information about how to configure printing.

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 8/12 [email protected] 7. Creating form layout A special user interface has been created to allow the user to easily create and modify the printing layout. The functionality is identical wheather created from the Pos Controller or from Axapta. When a new layout ID has been choosen, a dialog is shown below.

Figure 6 - An empty form layout

As can be seen, the layout is split up in three main sections; Header, Lines and Footer. The transaction receipt layout is the only layout that requires all the three sections, most of them only need the Header section. To change each of the sections a corresponding button must be pushed and then the available variables will appear. For example if you want to add a footer variable, you press the Footer button, get a list of footer variables and then drag’n’drop the variable to the footer section of the layout (which will be the only enabled section at that time). Figure 7 and Figure 8 show a variable that was dropped on to the foooter section. It is configurable how many lines each of the three sections span by adjusting the number in the right lower corner of each section.

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 9/12 [email protected] When a variable has been dropped on to the form and selected, it has some properties that can be set. The properties are as follows:

Characters: The number of characters possible for the variable. The example below shows a line of 28 characters (the variables and sizes are fictional). 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 A d d r e s s P o s t a l N a m e The Addrees field has been set to 12 characters. This means that the text “My road 5” will start at the 2nd character in the line and occupy 12 characters even though it is only 9 characters of length. The last 3 characters will be set whitespace. If the word “1004733” will be written to the Postal field which is set to 6 charaters, then the word will start as the 16th character but will be truncated to fit the field. Therefor only “100473” will be written. The Name “Iceman” will fit nicely in to the space of 6 characters. The result will be as seen below: M y r o a d 5 1 0 0 4 3 7 I c e m a n

Align: This can be either Left or Right. Setting the Address variable to right will have the following effect: M y r o a d 5 1 0 0 4 3 7 I c e m a n

Fill char: This is the whitespace character which by default is the empty char but can be set to any character. Setting this to ‘*’ to the Address field will have the following effect: M y r o a d 5 * * * 1 0 0 4 3 7 I c e m a n

Is variable: Sometimes it is desired to put some text to the form without having the Pos modifying it. The Text “variable” can be dropped on to the layout to insert any constant text.

Prefix: Font type: The font type can be either Normal or Bold. Normal character occupy only one charcter. Bold is a bit different than is known in word processors because being bold in this concept means that bold letters take twice as much space. Seting the Address field as bold would have the follwoing effect: M y R o a 1 0 0 4 3 7 I c e m a n Printing “My road 5” which normally would take 9 characters, now takes 18 characters when set to bold. Because there are only 12 characters to use, it can only contain 6 bold characters. Last 3 bold characters will therefor be truncated.

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 10/12 [email protected] Figure 7 - Footer section set ready

Figure 8 - A variable dropped on to the footer section Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 11/12 [email protected] 8. Configuring printing At the moment there is no configuration available to specify which printing operation is linked to which layout ID. This link is hard coded in the following way:

Operation name Print LayoutID operation ID Receipt 1 1 CardReceiptForShop 2 2 CardReceiptForCust 3 3 CardReceiptForShopReturn 4 4 CardReceiptForCustReturn 5 5 EFTMessage 6 6 CustAcntReceiptForShop 7 7 CustAcntReceiptForCust 8 8 CustAcntReceiptForShopReturn 9 9 CustAcntReceiptForCustReturn 10 10 TenderDeclaration 11 11

Landsteinar Strengur hf. Ármúla 7 108 Reykjavík Sími: 550 9000 Fax: 550 9010 www.landsteinarstrengur.is 12/12 [email protected]

Recommended publications