You are on page 1of 35

1

Rpv Report Viewer and Print Server.


Contents Rpv Viewer How to use Rpv Viewer Toolbar How to start Rpv Viewer Rpv print server How to start rpv print server Rpv print server interface How to configure the server Configuration of different types of files Communication between your program and rpv server Different file types. Specifications How to hold and release reports Rpv and Rpd files. Programming reports. Configuration, header, data sections Sample of an rpv report Rpv Commands. Settings Report_title Orientation Papersize Spacing Print_alowed, save_allowed, export_allowed Barwidth Pagelength, Pagewidth Common MaxY LM (left margin) and TM (top margin) Declaring columns Rpv report commands List of rpv commands Sample of report Rpd reports Sample of Rpd reports Editing a report How to make an exportable report Working with Rpv server on a remote FTP queue. How to use Rpv Queue Connection (RpvConnect). Quick reference for programming reports. Configuration section Header and data sections 14 15 16 16 17 19 19 19 20 20 20 21 21 22 22 22 22 22 23 23 24 25 25 26 27 28 29 30 30 32 5 5 5 7 8 8 9 10 12 13

Overview. Rpv is a printing system which includes a really easy report programming language. Rpv was developed at first to solve a well known problem: the old DOS programs didnt print properly when our customer began to change the printers. We couldnt condense fonts anymore, cut pages, and print with the quality that we wanted. Just imagine we didnt want to migrate to Windows because Epson printers were not so popular now. On the other hand, we had had some problems with other applications to develop reports. To us was not acceptable to have a 500 pages book just to learn how to develop a report. Rpv is an interpreter of rpv commands so you generate the report using the language that YOU want. Besides, we needed some special things such as barcodes in the report and other tools couldnt give us those features. With Rpv is possible to develop reports using any programming language (running on Windows, DOS and even UNIX OSs) because what the developer is doing is only generating an ascii text file that will be read by the program and formatted according the commands and specified settings. Rpv lets the developer to insert all the needed images into a report and change colors of the font for an specific field if a condition is true of false, printing barcodes, draw boxes and lines, and of course opening, saving and exporting reports. Rpv also allows to specify the size of paper, letting you use envelopes or special forms. It is possible to generate templates to create forms and insert them into the reports. In fact, this version also has the ability to handle two different kind of templates. Besides, the viewer and the print server are able to handle ascii plain files what is specially useful for non-Windows operating systems using the FTP queue connection feature. Rpv also provides a friendly graphical users interface to view the reports before they are printed. Since RPV reads ascii files (RPV, TXT, etc), those files can be created with DOS or Unix applications for example, and since RPV is a Windows application, reports created on these environments can be printed using Windows features with Windows quality.

What Rpv is good for. First case in which Rpv will be useful for you is if you develop Windows applications and you need to have control over your reports or you want something specific. Other very normal case is when the developer has non Windows (DOS for example) application already developed and running but needs to have better printing quality. Rpv will let you with really minor changes format your DOS reports to be printed by Windows with Windows quality. In this case is important to observe that the final user will not be affected by screen changes for example to jump from a DOS screen to a Windows screen unless the printer opens a window when begins to print. Rpv will let you print from DOS with Windows style without the user realizes that is working with a Windows application too. Another important thing that you will be able to do with Rpv is to print Windows style reports even from Unix applications. This means that you could be working directly to the Unix server via telnet and print a report in your printer or in a central printer. Rpv has two ways to work: viewer and server. Rpv report viewer

The report viewer is an standard interface that shows the report and lets the user to print, save and export reports, such as navigate throught its pages, zoom in, zoom out, etc. Rpv print server

The print server allows the developer to print reports automatically with/without the preview. This is specially useful for printing reports that come from DOS programs when the developer does not want to jump from a DOS screen to a Windows screen. Using print server will be transparent to the user. In fact, it is possible to print high quality reports (using bitmaps, barcodes, fonts, colors, etc.) from a DOS report using any printer, even if the printer is attached to a network. The print server can also be used in the same way to print reports that come from a Unix server with the same quality using the FTP queue connection.

RPV Report Viewer. User interface.

How to use RPV viewer. The use of this interface is really simple and it is oriented to all those final users that do not have much experience.. Toolbar.

As you can observe, the toolbar is a really standard one and it does not need much explanation. Anyway, using it, the final user will be able to navigate the report and perform operations such as printing, opening and saving, exporting, etc. Lets see one by one, the buttons.

First page button. Goes to the first page of the report. Previous page button. Goes to previous page of the report. Goto button. Goes to an specific page. When user hits this button is prompted to specify the

number of the page to go. Next page button. Advances one page. Last page button. Goes to the end of the report. Zoom in. Enlarges the report. Zoom out. Squeezes the report. Print button. Sends the report to the default printer. Print setup button. Opens a dialog box to customize the printing of the current report.

File open button. Opens an already saved report. It accepts to open RPV, RPD, TXT, LST and PRN reports. Save report button. Saves current report asking for a filename. Export report button. Exports the current report to a delimited text file. Exit button. Closes the viewer. About button. Shows information about the application.

How to start RPV viewer.

To start Rpv for viewing reports, you only have to type Rpv [report.Rpv] or select the option menu. Rpv.exe file can also be executed using Windows Explorer. Executing only Rpv without arguments, the report viewer will be opened letting the user to open already saved reports. If the user wants to start the viewer opening a report, the file name must be specified at the prompt. It is important to remember to specify the extension of the file so the viewer must open it in the appropiate way. If it is needed to open the application viewing a file using for example Visual Basic, the operation is very simple: Var = Shell(c:\program files\rpv\rpv.exe file_to_open, VbMaximized) In this case we use the shell function of VB that executes a program, specifying that the viewer will be opened in a maximized window. This application can open some different type of files such as RPV, RPD and plain text files. In case that the file to be opened is not an RPV file, then the extension must be specified. Example. Var = Shell(c:\program files\rpv\rpv.exe text_file.TXT, VbMaximized) In this case, the viewer is opening a TXT file so it must be specified. We are going to do the same to open all files that do not have RPV extension. Important: in the examples that we saw, have the full path to open the application. It is recommendable to declare the directory in which RPV is installed in the PATH string in AUTOEXEC.BAT to have access from any directory and any drive. In that case, the first example could be: Var = Shell(rpv file_to_open, VbMaximized)

Rpv print server Like we said before, the print server will manage reports in background allowing a program to send reports directly to printer. Rpv print server can be started in two different ways. Server Visible Server Invisible The capabilities of the program will be the same, but the final user will or will not see the server interface. In almost all cases the server should not be visible. Anyway the user will be able to hide/show it as desired. How to start RPV print server. Rpv s [-e] [-v] [-i] [-pqueue_dir] [-ffilename.cnx] As you can see there are not many options to start it. Here the explanation of each one. -s Tells RPV.EXE program to open in server mode. Remember that it can be opened in viewer mode too. Enables the ability of editing reports. This feature lets the programmer to see the source code of the report using the viewer by pressing ctrl-e keys. Shows the rpv server console, if this flag is set, the server will start with the queue closed, if this flag is ommited the console will be invisible and queue will be opened automatically. Hides the little icon shown in the taskbar when the server is running. This is specially useful not to allow the user to configure the server. In fact the final user wont know that a server is running. Specifies the queue directory. Rpv works printing all those reports that you/your programs place in the queue directory. If you ommit this, the default queue directory will be c:\temp. If it does not exist the application will show an error when starting. Specifies the connection file to use a remote FTP queue. Rpv can have a remote queue directory on an FTP server. To perform this you must have the CNX file that tells the Rpv server the host, username, password and queue directory of the remote FTP server. See remote FTP queue utility to create these CNX files.

-e -v -i

-p

-f

Example: RPV s i pf:\myreports fc:\ftp_queue This example tells the program to open in server mode, hiding the little icon, having the reports in f:\myreports and connecting to an remote FTP queue using the connection file c:\ftp_queue.cnx

Rpv print server interface. Using the print server interface it will be possible to open/close, configure, and view reports.

As you can see, the server console is an small window with few options. One of the things to explain at this point is the reason of the held and released reports. It happens that the rpv server doesnt know when a report is done or when it is being generated. If the server finds a report that is being created, an error can occur. Just imagine that the server is trying to print a file that is not 100 % created. To prevent this, we recommend to create reports in held status. The reports that are held are not printed, even if queue is opened (when the square is green instead of red). After the report is created, it must be released to be printed. See How to hold/release reports. One by one all the buttons we can see on this screen. Empty Config Open Queue There are two buttons with the same text. Pressing these we empty the selected queue (held or released). Opens the configuration screen and shows more options. Opens/closes the queue printing or not depending of the state of the queue. When the queue is opened the color of the square will be green and when it is closed, it will be red. Text in button will change: Open Queue or Close Queue depending of the state of the queue. Opens the about dialog box. Pressing this button, the server console will be hidden and all you will be able to see is the little icon on the taskbar. To restore the window, just double click on the icon. If the server was started with -i flag, user will not have the ability to restore/minimize since the icon is not on the taskbar. Terminates the execution of the application. It does not empty queues.

About Minimize

Shutdown

How to configure the server. The configuration of the server is very simple and it can be saved for future sessions. Just hit the the config button on the server console.

Using this interface you will be able to set the queue directory, specify which files will be printed, and configure the remote FTP queue.

These three options will determine if those types of files will be printed or not by the server. You may want to print only RPV files but not TXT so you unselect text files for example. In most of cases three options should be selected.

The queue directory can be changed here telling the server a new directory. It is important to advise that only one queue directory can be declared at a time. Use the browse button to select the directory that you want to be the queue directory. The application wont permit to select a root directory as a queue directory because root has important files not to be deleted. It is really important that you define an special directory (better if you have created it specially for the rpv server) and be carefull not to place files that you dont want to be deleted on it . Rpv prints and deletes the files permanently. Other important thing is to be sure that you/your program has full access to the queue directory (read/delete) because the server needs to delete files. If the files cant be deleted, the server will print them each time the files are found.

10

The CNX file is the file that has all the information about the remote FTP connection. If this field is blank the rpv server wont connect to any remote FTP server. See FTP queue connection utility to learn how to create CNX files.

Specify here a range between 5 and 60 seconds to check the remote FTP queue (if CNX file is specified). A good value for this field is 20.

These three buttons will let the user to perform a complete FTP queue configuration. Clicking the button Launch FTP Queue Connection Utility you will be able to create and edit the CNX files. The other two buttons work together to connect the rpv server to the FTP server. To connect to the remote FTP queue (or if you want to change your connection), you must test the connection first. This means that the button Connect to FTP queue now will be disabled while you dont hit Test connection. Once you tested the connection (and the connection is succesful) the button to connect to FTP queue will be enabled. Once it is enabled, just hit it and the changes will take effect.

Click on Save configuration to save the changes to disk. After this, when you start the server it will take these option by default.

11

Configuration of different file types. Rpv has the ability to print different type of files. All of them can be configured by pressing Files configuration button.

After you click this button, next window will appear on the screen.

When this window is shown, the only field that is going to be enabled is File type and you will have to select the extension you want to see/modify.

Once you have selected the desired extension the rest of the fields will be enabled. After you finish to modify the settings of EACH extension, click on apply button to changes take effect.

12

If you want to save these settings permanently click on Save configuration button in previous screen. It is important to say that TXT, LST and PRN files are basically the same kind of file: ascii plain files. What we pretend by separating them is to have three different configurations for the same kind of file. For example if your DOS application has to print some reports using a font size and some others using another one, you can just define ones as TXT and others as LST for example. After that you must configure the print server as desired.

Communication between your program and the Rpv server The rpv server can perform, even when the interface is not visible, some actions that could be very important for your applications. For example suppose that your program is about to generate hundreds of reports (such as invoices) to be stored first to be printed all together some time later. In that case you might want to close the queue not to let them to be printed. You may also want to empty queues before begining. Rpv server accepts commands that are stored into CMD files that means command. A CMD file is any name with CMD extension and has to be placed into the queue directory to be executed. When the server finds a CMD file, it executes it as soon as possible. If the server is printing a report, it executes the CMD file after the printing of the current report. Here is a list with the commands accepted to control the print server. OPEN_QUEUE CLOSE_QUEUE HOLD_ALL RELEASE_ALL EMPTY_HELD_QUEUE EMPTY_RELEASED_QUEUE RESTORE_ME HIDE_ME SHUTDOWN Opens the queue (sends reports to printer). Closes the queue (stops printing). Sends reports from released queue to held queue. Sends reports from held queue to released queue. Deletes all the files in held queue. Deletes all the files in released queue. Shows the print server interface. Hides the print server interface. Terminates the execution of the print server. It does not prompt for any confirmation.

Basically, the commands described above are the same you have in visible mode. These commands have no arguments and to be executed, they have to be in the specified directory for the queue and with the CMD extension. The server will delete each CMD file once it has been entirely executed with the exception of the SHUTDOWN command, which wont delete the file. Anyway, each time the server is started it deletes all the CMD files with the exception of the AUTOEXEC.CMD which will be executed when the server starts and after the execution it will be deleted. This CMD file will be useful to start the server in an specific way; for example, emptying the

13

queues. It is important to observe that the server wont warn anything if you make a mistake executing a command, in fact, it will be skipped. The CMD commands will work if the server is visible or invisible so you will be able to test the behavior of the application. About the frequencies the server uses to search. The print server searches the directory every five seconds. If the server finds reports in the released reports queue, they will begin to be printed by name. This means that the server wont print the reports exactly the order they came. So if you want to print reports in an specific order, you will have to name them according the order you want them to be printed. If the server finds reports, those five seconds will disappear and the application will print all the reports in one step without stopping until it finishes, when it will begin searching every five seconds again. Anyway, if the server is printing jobs and you insert a CMD file in the mean time, the commands that are into the file will be executed after the printing of the current report so it wont be necessary to wait until the queue is empty to close it.

Different files types. Specifications. Rpv (server and viewer) can accept different file types. They are: Extension Rpv Rpd Txt Lst Prn Description standard Rpv file. Rpv data file. plain ascii file. plain ascii file. plain ascii file.

Extensions are not case sensitive. They can be in upper or lower case.

First two extensions are native Rpv extensions, which will be explained later. The rest of the extensions are plain ascii files that can be printed/viewed by rpv according with the specified settings in RPV.INI file. Remember that RPV.INI file is created/modified by the rpv print server when you configure its options. It is important to say that TXT, LST and PRN files are basically the SAME KIND OF FILE: ascii plain files. What we pretend by separating them is to have three different configurations for the same kind of file. For example if your DOS application has to print some reports using a font size and one specific paper orientation and some others using other settings, you can just define ones as TXT and other as LST for example. After that you must configure the print server as desired.

How to hold and release reports. As we said before, we have five extensions recognized by the print server.

14

To hold a report we must change the extension of the file according to the following table. Released RPV RPD TXT LST PRN Held RP RD TX LS PR

According to this table to hold a RPV report you must rename it with RP extension. If you want to release the same report, you must rename it as RPV extension again. Please observe that with the exception of RPD files, the rest of the files have the same extension without the last letter. RPD files are RD not to have conflict with RPV files.

IMPORTANT If you have an application that prints reports automatically, generate it as a held file until the report is done and closed. Once you have the report done, rename it with the released extension. This means dont create released reports in the queue directory while the server is running or the queue is opened. Other interesting thing is to create the released report in other directory (not the queue directory) and when it is done, to move it to queue directory to be printed.

15

RPV and RPD files. Programming reports. Rpv and Rpd files are the native files of Rpv application. We will begin with Rpv files, and when were done, the Rpd files will be explained because is needed to learn Rpv to understand Rpd (Basically Rpd files have data to be inserted into Rpv files). An Rpv file is a normal ascii text file with extension Rpv and must be structured in an specific way. With Rpv, you are not sending the report directly to the printer, so you are only generating a text file. If you are modifying and your program sends data to the printer, you will have modify the program to print a file. Before beginning, you must know that you will only have to take care of the Xs and not of the Ys. This doesnt mean that you only have control of the columns of you report but probably most of cases will be this way. Since all the files that the application can print/view are ascii plain files, Rpv files can be generated using any language running on any operating system. In fact you could use the awk in any x OS to generate one rpv report. In an Rpv file, we can recognize three sections. Configuration Header Data

The configuration section is the section in which the report has values such as papersize, default printer, report title, etc. You can recognize it because it is at the top of the report before the header section. The header section is the text that will be printed in all the pages of the report. In header section you can define footer too as desired. It is recognized by the identifier [header]. The data section is the data of the report and it must be placed after header section. It will be recognized by the identifier [data]. The data will change page by page. If youre familiar with DOS programming, you will remember that you can place 80 chars per line, or sometimes 132 if you are compressing the font with a standard letter paper. Rpv needs you to define columns too, but for that youll have to say it in twips and not in columns. Each centimeter has about 567 twips and each inch has about 1440. This means for example that if you want to place a text two centimeters from the left margin, you will specify {1134}. (567 * 2). This example specifies 2 centimeters, its more used to specify round values. Ex: {1100}. The following is an easy example of an Rpv report. To test it just open a notepad or even a DOS editor, paste this code, and save it with rpv extension. The difference of colors is only to show the different sections of the report. Report_title=Sample of an Rpv report.

16

Orientation=2 [header] {f=arial;s=12;b=y;\n} {400} Sample Rpv report {s=10;\n;\n} {400} Name [data] {400} Agustina Lovatto {400} Brian Mercer {400} Jony Bekenstein {400} Kevin Mercer {400} Melody Lovatto {400} Ornella P. Merlo {400} Stefi A. Piccoli

{3000} Address {3000} {3000} {3000} {3000} {3000} {3000} {3000} Callao 355 Asamblea 733 Pedro Lozano 5433 Asamblea 733 Callao 355 San Nicolas 122 Mercedes 2074

{b=n;\n;\n} {\n} {\n} {\n} {\n} {\n} {\n} {\n}

How you see it with the Rpv viewer.

As you can see, what Rpv viewer (or server) is interpreting is a plain file, and you give commands to it with the strings that are between brackets ({ and }). The case that we see here is a report that doesnt have much data. If it has more data, the viewer/server will take care of the pages.

Rpv Commands. To format text using Rpv, you must learn the commands that are accepted by the Rpv. Commands are between brackets and you can join them by separating with a semicolon char. In the source code that we saw before, observe how the report is built. You can see for example the strings {\n} are all in the same column. This format is not required, in fact Rpv doesnt need that you leave any space between the text that you want to print and the commands. By the way, it is important to know that the interpreter will cut the strings and will ignore the spaces (the strings will be trimmed). If you want to avoid this, just place another char instead of space; for

17

example could be a chr(160) Here is the same example without the spaces. Report_title=Sample of an Rpv report. Orientation=2 [header] {f=arial;s=12;b=y;\n} {400;c=2}Sample report{c=0;s=10;\n;\n} {400}Name{3000}Address{b=n;\n;\n} [data] {400}Agustina Lovatto{3000}Callao 355{\n} {400}Brian Mercer{3000}Asamblea 733{\n} {400}Jony Bekenstein{3000}Pedro Lozano 5433{\n} {400}Kevin Mercer{3000} Asamblea 733{\n} {400}Melody Lovatto{3000} Callao 355{\n} {400}Ornella P. Merlo{3000}San Nicolas 122{\n} {400}Stefi A. Piccoli{3000}Mercedes 2074{\n} Rpv executes both reports in the same way. IMPORTANT. If you want to represent brackets ({ or } or both) into your report, you can solve that situation by using thee OPEN and CLOSE settings at the configuration section. After that you can use the brackets and you must use the declared chars to open/close settings. Example: Report_title=How to use OPEN & CLOSE Open=/ Close=% [header] /f=arial;s=10% /1000% The chars { and } are going to be displayed now /\n%

18

Rpv commands. We must separate this section in two: settings and commands. Settings. We will use settings to define some parameters in the first lines of the report (configuration section). Most of the settings have a default value and it will be necessary to use some of them only when we need something special. We will try not to specify settings unnecessaryly. The settings will be expressed in the same way that we express settings in DOS or even in UNIX. Example: SETTING=VALUE. The following is an example of a configuration section of an standard Rpv file. Report_title=Detail transactions report. Papersize=A4 Orientation=2 Spacing=250 $column_01=1000 $column_02=2000 $column_03=3000 $column_04=4000 Observe that the last four settings are columns and they define the position (in twips) of the columns. Their use is optional and Rpv lets you specify the column or a literal in the header or data sections. Example: {$column_01} equals {1000} The following are the settings that will be accepted by Rpv. REPORT_TITLE: This setting specifies the title that the report will have when is opened with the report viewer and it is not needed for those reports that will be sent to the printer automatically with the Rpv server. If report_title setting is ommited, the title in the window will be the temporal file that the viewer will generate to see the report. That file will be a number with the extension $$1.

19

ORIENTATION: This setting specifies the paper orientation (portrait or landscape) for a report. Only one orientation per report is accepted by the program. This means that all the pages in the report must have the same paper orientation. The default value for this setting is 1 that means porttrait. To set the orientation to landscape use the value 2. Example: ORIENTATION=2 The report will be printed with landscape orientation. Remember that to print a report using portrait orientation it wont be needed to set this variable. PAPERSIZE. This setting specifies the type of paper that you will use. There are some types already loaded into the program but you can change the size of the pages using the settings PAGELENGHT and PAGEWIDTH. The types of paper accepted by Rpv are: A4, letter, executive, legal, B5, envelope10 and envelopedl. The default value for this setting is A4 and any value that is not listed above will generate a warning telling you that the papersize is not recognized and A4 will be set automatically unless you have set pagelenght and pagewidth settings. SPACING. This setting will determine the space between lines. Like the rest of the values it must be expressed in twips. The default value for spacing is 200. If you are going to work with big sizes of fonts it will be necessary to change it. Try changing this value and reload the report to see the effects. See also spacing command. Note: Remember that each centimeter has about 567 twips and each Inch has 1440 twips.

20

PRINT_ALLOWED, SAVE_ALLOWED and EXPORT_ALLOWED. These three settings will determine if the reports will be allowed to print, save or/and export. The default values are Y for them and they will only work with the Rpv viewer. Rpv server wont pay attention to these settings. SAVE_ALLOWED=N PRINT_ALLOWED=N EXPORT_ALLOWED=N The example above will show a report to a user but the report wont be allowed to print, save or export. This will be useful for example if the viewer is showing an invoice that should not be reprinted. Even when the Rpv server wont attempt to save and export reports, it will print the reports even if PRINT_ALLOWED is set to N. BARWIDTH This setting defines the size (lines and spaces separations) of the barcodes that the report will use. Three values are possible and each one has its own application.

1 (default) Will print the barcodes using the minimum size. It will be recommended for laser printers.

2 This setting will print the barcodes using a medium size and its recommended for inkjet printers.

3 This setting will use the maximum size and will be recommended for dot matrix printers.

21

PAGELENGHT, PAGEWIDTH Use these values to define an special type of paper. They must be expressed in twips. PAGELENGHT and PAGEWIDTH are not compatible with PAPERSIZE. In fact, what PAPERSIZE does is to set these two settings avoiding you have to do it. The setting ORIENTATION will work normally with these settings. COMMON This setting will determine the commands that the program will use as default. Everytime the header of the report is shown or printed, the string COMMON will be sent before the [DATA] of the report. This setting wont be necessary if the programmer pays attention to open/close some values like bold, size, font, etc. Example of common setting. COMMON={A=L;F=TIMES NEW ROMAN;S=8;B=N;U=N;I=N} The string that you see above means: A=L F=TIMES NEW ROMAN S=8 B=N U=N I=N MAXY This setting determines the maximum Y value for text before beginning a new page. By default, MAXY will be the page lenght. Modify the Maxy value to cut the page the way you need. LM, TM LM (left margin) and TM (top margin) are used to determine the margins for your report. Changing these values will be specially useful when it is necessary to fit an entire report into a page. Top margin and left margin will affect the entire report. Its important to observe that the top or left margins could be possitive or negative numbers. Double click on the status bar of the viewer and you will see the margins. Declaring columns. Rpv accepts to declare some values in the configuration section to use them as columns. This is useful for changing all the values modifying only one value in configuration section. To declare a column, will be required that the column has a name that begins with $ char. After that, you can type the name you want for the column containing even spaces. Alignment left. Font name. Size of the font. Font bold = No Font underlined = No Font italic = No

22

Example: $COL_0=400 The value will be expressed in twips and after this declaration {400} will be the equal {$col_0} (lower or upper case doesn't matter). If you have declared columns, double click on the status bar to see them and their values.

It is desirable (but not required) not to declare columns with long names because it can affect the performance of the viewer and server; specially the viewer (lets remember that even when the system is slow, it will be faster than most of printers).

Rpv report commands

The following commands can be included into the [header] or [data] section of your report. They dont work in configuration section There are no many Rpv commands and all of them are easy to remember and easy to use. Here a list with commands accepted by Rpv. \NP \N \P C= A= BAR NOBAR U= B= I= E T S= F= PIC= LINE= COPY= BOX= W= SPACING= TOPOFPAGE XYLINE= New page. Terminates current page and starts a new one. Next line. Previous line. Font foreground color Text Alignment (Left/Right/Center) Begin of barcode printing. End of barcode printing Font underlined yes/no Font bold yes/no Font Italic yes/no Determines if the line will be exported in an export operation. Inserts a ; when the report is exported as a delimiter. Sets Font size Sets Font name Inserts an image file into your report. Draws an horizontal line into your report. Inserts a file (with Rpv format) into your report in an specific place. Draws a box into your report. Determines the width of the line drawn. Determines the space between lines for the next \n or \p operation. Returns to the top of current page. Draws any line into your report.

All the commands must be between brackets ({ and }) to be read by the program, so for example if you want to change the color for a text when the previous one was black (zero) and after that to go to next line you must type

{C=2} this text will be printed green {C=0} {\N} When you have to specify more than one command you can separate them using ;.

23

Here is the same example: {C=2} this text will be printed green {C=0;\N} Here there is another easy example of a report.

REPORT_TITLE=Test of Rpv report ORIENTATION=1 PAPERSIZE=LETTER SPACING=250 MAXY=5000 SAVE_ALLOWED=N PRINT_ALLOWED=N EXPORT_ALLOWED=Y $column_00=400 $column_01=1500 [HEADER] {f=arial;s=10;a=l} {4000} Page {pag;\n} {$column_00;b=y} ID# {$column_01} Name {\n;\n;b=n;s=7} [DATA] {$column_00} 359 {$column_01} MARCELA RIQUELME {\n} {$column_00} 360 {$column_01} MARIA DE LA LUZ BOETSCH {\n} {$column_00} 361 {$column_01} CANILO RIMA {\n}

You can repeat the structure in data section until you dont have more records to show and Rpv will take care about where the pages begin and end. See Quick reference at the end of the document to check syntax for the commands.

24

Rpd reports. Rpd type is Rpv data files. They contain the data that will be inserted into a report. At first this feature was specially designed to solve the problem of storing thousands of invoices in a little disk space but it can help you to work easilly with forms. The Rpd file gives the data to other file (with Rpv format, not required Rpv extension) and has to be linked to it. template=c:\templates\template_carnet.rpv @photo=c:\program files\rpv\stefi.bmp @id_numb=41222333 @name=Stefana Piccoli @address=Mercedes 2074 Capital @phone=0115411-4554-1234 @birth_date=27/02/1999 The structure is really basic: in the first line of the report, the template must be declared. In this case, this Rpd file will work with the template c:\templates\template_carnet.rpv. After the first line, the structure is very simple; @Variable_1 = Literal #1 @Variable_2 = Literal #2 @Variable_3 = Literal #3 On the other hand, to make this work we must have the template where the Rpd file says it is placed. Here we show the contents of c:\templates\template_carnet.rpv report_title=Carnet spacing=200 barwidth=2 $c0=1700 $c1=3500 $c2=3700 [header] {f=arial} [data] {w=1;box=800,1000,5000,3000} {box=850,1050,1800,1800;spacing=1200;\N} {pic=@photo,900,1100,1700,1700} {c=1;f=Times new roman;s=11;b=y;a=c} {4300} REPUBLICA ARGENTINA {SPACING=250;\N} {S=8;4300} GOBIERNO DE LA CIUDAD {\N;4300} DE BUENOS AIRES {\N;\N} {f=arial;c=0} {b=n;a=r;$c1} ID: {b=y;a=l;$c2} @id_numb {\n} {b=n;a=r;$c1} Name: {b=y;a=l;$c2} @name {\n} {b=n;a=r;$c1} Adress: {b=y;a=l;$c2} @address {\n} {b=n;a=r;$c1} Phone: {b=y;a=l;$c2} @phone {\n} {b=n;a=c;$c0} @id_numb {a=r} {$c1} Birth date: {b=y;a=l;$c2} @birth_date {\n;\n} {s=18;1200;bar} @id_numb {nobar;\n} If you open this code as an Rpv report, you will see all the variables, but if you open the Rpd file, you will see the final result.

25

Editing a report. From the Rpv viewer screen, you will have the possibility to edit the report that you are viewing. To do so, all you have to do is pressing ctrl-e in any point of the viewer. Notepad will appear with the source code of the report. Then the user will have the possibility to see and modify the report and reload it when the notepad is closed. To do this, dont forget to start with -e option. After the edition, the viewer will ask you if you want to reload the report that you have edited. It is important to know that the report that youre editing is not the original source report. It is only a temporal file. In fact, if you have any copy into your original report, you will be able to see that copy inserted into this temporal file. So if you want to save it you will have to select save icon in the toolbar after reloading it. This will be specially useful when the developer needs to know the changes that have to be done in the program before doing them. Something else that is possible to do from the viewer is to see the margins and the declared columns, just double click on the status bar and two lines will be shown telling you the top and left margins. Those lines will be X and Y = 0. The columns will appear with their names and values. By pressing ctrl key while moving the mouse on the report, you will see the values of X and Y in the status bar.

26

How to make an exportable report. Rpv lets you export reports, but you must know a couple of things before doing it. To be exportable, the line must begin with {e} . This setting tells the rpv when exporting to export that line. This is to avoid exporting garbage or data that is not useful. For example you might not want to export all the titles of your report. Besides that, you must determine when to insert a delimiter using {t}. Example: The line {e;a=l;$c1} George {$c2} Zacarias {\n} Will be exported like: George Zacarias Or {e;a=l;$c1} George {t;$c2} Zacarias {\n} Will be exported like: George;Zacarias

27

Working with Rpv server on a remote FTP queue. Rpv is able to work with queue that is in an FTP site which could be running any operating system such as Unix or Linux. If you are working with a Windows network you will only have to redirect your Rpv files to a shared directory and tell Rpv server that that shared directory is the queue. If you are with Unix for example you will need to define an FTP queue. To define a queue on an FTP site first thing is to have an FTP server running on the remote computer and it is needed to have a dedicated directory for Rpv and related files such as image files and templates. After that, you have to create the CNX file by executing the FTP queue connection utility which will create a file contaning the host, username, password and queue directory on the remote computer. To do so, you can select the option that is shown in the menu or you can execute RpvConnect.exe file. From the rpv server you can launch the program too. The file this program will create is a CNX file that means connection but if you want to change that extension you can do it. That file will be called by Rpv when the server starts. The file generated by RpvConnect will be encrypted. To place a report in a queue, dont generate it on the queue directory. It is recommended to create it in other directory and after the report is created, move it to the queue directory with its related files such as bitmaps, includes, etc. On an FTP server, Rpv application doesnt find held reports. If the application finds a report (Rpv, Rpd, Txt, Lst and Prn) file into the directory, the program will download all the files that are into that directory to the local queue directory to be printed after. After the downloading Rpv will delete all the files that downloaded but if you dont want a file to be deleted, make sure to change the attributes to the file not to be deleted by the program. In case that the FTP server runs on an X os (Linux, Unix, etc) the report must be converted using xtod command to be read properly by the Rpv. (XtoD means Unix to DOS and converts the ascii file to DOS format; you may need another similar command depending of the OS that you are using. nothing for Windows NT or 2000). To work with Rpv using an FTP site, it is recommended to have all the bitmaps (logos for example) and templates on the local hard drive and place only reports on the queue directory to avoid downloading many files from the server. VERY IMPORTANT NOTE. It is extremelly important to have a DEDICATED directory only for queue. It is recommendable to create a new one for this purpose. Ex: /tmp/rpvqueue . The reason is that the files are deleted once they are printed. Never use $home or root directories.

28

How to use Rpv Queue Connection (RpvConnect).

Open the program using its icon or execute RpvConnect.exe program and this screen will be shown. As you can see, it is needed to give the program the necessary information to have a connection with an FTP site plus the directory in which the program will search for Rpv files. After giving the program the information, should save the file to disk using the option save. This will generate the CNX file. You can also edit an already saved file using open option. The passwords are never shown. It is strongly recommended that you use the option Test connection, available in the menu to confirm that the connection that you created/edited works properly.

29

Quick reference for programming reports.


Configuration section. The configuration section is defined by the firsts lines of the Rpv file until [header] section appears. In that section the programmer will define values for settings. The possible settings are:

BARWIDTH

Defines the width of lines and separations of the bars for printing/showing barcodes. Possible values are 1 (default), 2 or 3.

COMMON

Defines a string with Rpv commands that will be sent immediatly after the header is printed or shown. This setting wont be necessary if all the commands are opened/closed properly.

EXPORT_ALLOWED

Defines if exporting the report will be permitted. Values Y or N

LM

Defines the left margin (in twips).

MAXY

Defines the maximum value for Y (in twips).

OPEN_VIEW

Tells the server to open the viewer instead of send the report to the printer. (This works for those reports that are printed throught the server).

ORIENTATION

Defines if the report will be printed/shown portrait or landscape orientation. 1=Portrait, 2=Landscape.

PAGELENGHT

Defines the lenght of the page (in twips).

PAGEWIDTH

Defines the width of the page (in twips).

PAPERSIZE

Defines the type of paper for the report.

PRINT_ALLOWED

Defines if printing the report will be permitted. Values Y or N

PRINTER

Defines which in which printer the report will be printed. The value for this setting must be the name of the printer for Windows.

30

REPORT_TITLE

Defines the title of the report (window title).

SAVE_ALLOWED

Defines if saving the report will be permitted. Values Y or N

SPACING

Defines the space (in twips) between lines.

TM

Defines the top margin (in twips).

Remember that the syntax for setting these values will be SETTING=VALUE. Example. REPORT_TITLE=Detail transactions report The programmer does not have to use quotes in this section.

31

Header and data sections. The difference between header and data is that the header section will be repeated for every page that is displayed or printed. This means that the titles of a report will ussually go in header section but it is not required. What is required is that the header section exists even if it doesnt have information inside. The data section will be the body of the report and Rpv will separate them by pages automatically displaying a [header] on each new page. The commands are the same for both. The symbols { and } determine the begin and the end of the commands and the strings inside will be interpreted. All the strings that are not between these two characters will be printed. It is not necessary to open and close for each command. The commands can be separated using semicolon char ;. This means you can open using { char and write commands inside separating them with ;. After the last command, then you close them with } char. Remember that to define the position (column) that the text will be printed or shown, there is no command, it will be necessary only to specify the position value in twips or specify the column name for example $COL_01 after it was defined in configuration section.

Text commands. A Defines the alignment of text. Expressed with L,R or C. Ex: {A=L}

Defines the color of the font. Expressed in numbers from 0 to 16. Ex: {C=2} (color set to green).

Defines the name of the font. Expressed in letters. Ex: {F=Times new roman}

Defines the size of the font. Expressed in points. Ex: {S=18}

Font underlined. Expressed with Y or N. Ex: {U=Y}.

Font italic. Expressed with Y or N.

32

Ex: {I=N}.

Font bold. Expressed with Y or N. Ex: {B=Y}.

Other commands.

Tells Rpv to export the line in an exporting operation. No arguments. Must be first part of the line.

\N

Carriage return. Begins a new line. No arguments.

\P

Goes one line up. No arguments.

\NP

Begins a new page. No arguments.

TOPOFPAGE

Returns to the top of the page (Y=0). No arguments.

Inserts a delimiter on its place when exporting.The delimiter is ;. No arguments.

SPACING

Defines the value of spacing setting for next \N or \P operation. After a \n or \p operation, this value will be the original value. Ex: {spacing=4000;\n}

BAR

Defines that the text/numbers that are printed will be expressed in barcodes. No arguments.

NOBAR

Ends BAR. Ex. {bar} 11593468 {nobar}. No arguments.

COPY

Inserts an external file into the Rpv report. The external file (with Rpv format, not necessary Rpv extension) will be inserted in the place of the copy command

33

Syntax: COPY=FILENAME Ex: {COPY=\TEMPLATES\INVOICE.TXT}

PIC

Inserts an image file into the report. Syntax: PIC=FILE.BMP,X, [Y], LENGHT, WIDTH The values after the filename must be expressed in twips. In case Y is ommited, the image will be placed in the current Y position.

BOX

Draws a box into the report. Expressed in twips. Syntax: Box=X1,Y1,X2,Y2

BOXF

Draws a filled box into the report. Expressed in twips. Syntax: Box=X1,Y1,X2,Y2 Boxf will fill the box with the color defined using C command.

LINE

Draws an horizontal line into the report. Expressed in twips. Syntax: LINE=X1,X2 The value of Y will be the current value.

XYLINE

Draws any line into the report. Syntax: XYLINE=X1,Y1,X2,Y2.

Defines the width of the lines that will be drawn. These values are expressed in pixells. Ex: {W=1}

PAG

Shows the number of the current page.

DATE

Shows the current date.

TIME

Shows the current time.

HOUR

Shows the current hour.

MINUTE

Shows the current minute.

SECOND

Shows the current second.

34

DAY

Shows the current day (in numbers).

MONTH

Shows the current month (in numbers).

YEAR

Shows the current year (in numbers).

35

You might also like