Viper Printing Tool

Tools for Progress

Viper Printing Tool (3.3)

This documentation covers the Viper command language. For documentation on the Viper Designer click here.

  • Introduction
  • Basic Viper
  • The Viper-API
  • Viper Setup
  • Viper Utilities
  • Error Handling
  • The Preview's User Interface
  • What's new
  • Migration
  • What's next
  • Known Bugs and Weaknesses
  • How to purchase Viper
  • Release history

© IAP GmbH 1997-2015


Introduction

VIPER is a printer controller system for use with Progress version 9.1E and up, running in MS-Windows Vista or higher.
(If you are using an older version of Progress OpenEdge or Windows please mail to info@tools4progress.com)

Viper's goal is to allow the printing capabilities of windows systems to be used inside Progress, while retaining the transparency and controlability of the printing process for the program.With this objective in mind, all automatically engaged functions have been avoided wherever the programmer can retain practical control, without increasing the amount of superfluous programming tasks. The control over the page separation lies in the hands of the programmer, whereby a kind of automatic line feed exists through the group logic. On the other hand the text can be positioned on the paper relatively unrestricted.

With the Viper Designer it also offers a tool to easily design report templates without breaking its "give-the-control-to-the-programmer-not-to-the-program" philosophy, retaining the logical structure of the report in your Progress application.

Finally Viper comes with the Viper Assistant a small application helping you to deploy and configure Viper for your development environment. There is no such tool for the end-user deployment, because a "xcopy"-deployment should be enough: simply copy the Viper tree from your development area to your customer and probably run the "VprRead.exe" file to add a registry entry for handling Viper's report files.


Basic Principles

In the following sections we refer to using Viper with Progress V9.x. If you like to use Viper with Progress V8 you have to add in {&vpr_handle} to each Viper (vpr_XXX) procedure call.

After installing VIPER a demo application is available, consisting of some example procedures showing usage of VIPER.

Structure of a Viper program.
Cells and Groups - what's that?.
Graphics Functions.
Viper & the Viper Designer.
A Tip for Working with Viper.


Structure of a Viper program

/* Initialize Viper
    define {&vpr_handle} and declare Viper functions */
 {vpr.i INIT}

 /* some progress code */
 ...

 /* Start Viper
   run viper.p persistent, set {vpr_handle} and define as super proc */
 {vpr.i START}

 /* more progress code */
 ...

 /* Using Viper
    e.g. printer selection, paper orientation, previewmode.  */
 RUN vpr_SelectPrinter  ("My Printername").
 RUN vpr_SetPreviewMode ("direct").

 /* code-block with Viper and Progress commands:         *
  * The data is transmitted to Viper, the paging is      *
  * controlled here.                                     *
  * e.g. the text "Hello world..."  is created this way: */

 /* creating a group and cell with the text */
 RUN vpr_SetCellText  ("cell","group","Hello world...").
 /* and now 'print' this group */
 RUN vpr_FlushGroup  ("group").
 /* start the preview */
 RUN vpr_ShowPreview .
/*
 * tell viper that you're done. This also enables some off the buttons
 * of the preview window.
 */
 RUN vpr_EndDoc.

 /* Closing Viper, when the printing is done. */
 {vpr.i STOP}

 /* and even more Progress code */
 ...

Please take care that Viper is closed only after the work with Viper is done. On closing Viper is totally shut down. If the handle is closed too soon, the preview is closed as well and the Viper document is lost. You can use the vpr_ShowDoc command instead of vpr_ShowPreview to get a preview that stays until it is closed by the user.


Cells and Groups

Cells and Groups - what's that?

A page represents an object in which rectangular invisible areas, so called cells, are placed and can be sized accordingly. Through use of a variety of methods, the attributes of these cells can be changed, such as alignment, fonts, position or text.

The cells are ordered into groups, in which they can be mutually edited and made ready for printing. In this manner, logical lines are created that can encompass several print lines, according to the height of the cells in this group. The cells in a group are filled with text and attributes. The group is then prepared for printing (vpr_FlushGroup). The starting position of the cells in this group is now set under the old cells, i.e: on the previous bottom border of the group. The cells can then be filled with text again, their attributes respectively changed, and made ready for printing with a new content, as a new logical line.

For example, a header group (supplier, telephone number, date, etc.) and a footnote (e.g. a sum) could be created for a table of articles with different cells.

The construction of a list occurs through the definition of a line group, for example with No., article, and price cells. With vpr_SetCellText("article","my line","example") filled cells can then be returned with the command vpr_FlushGroup("my line") .The cells are then emptied and positioned on the next logical line. The second line can then be created with the same method.

It is important to remember that most operations in and on pages occur in the background. In this case, the order is unimportant. Only after the command vpr_FlushGroup is given can changes for printing be considered permanent.


Graphics Functions

Viper is also augmented with several graphics commands, which are neccessary for creating graphic lines, rectangles in different colors, etc. Moreover, bitmap graphics can be inserted.

Viper's Graphics functions are separated in two different kinds.

The DefXXX variety of grahics commands are bound to the page they are "defined" on. Contrary to the cells that hold the text, these objects are not necessarily connected to the groups. Because they are directly bound to a page they prepared for printing immediately after the appropriate command is given. Usually this kind of lines should be used for static graphics, like watermarks or page boundaries.

With Viper 3.2 the second kind of graphical objects - the new GraphObjs - where added. Like cells they are connected to the groups and therefore are moved according to the "logical line"-scheme of Viper and are only realised on the page, when a vpr_FlushGroup for their group is executed. These objects are created with the vpr_SetGraphObj command and have some nice additional features, like a z-order (i.e. you can place them over or under other objects). GraphObjs would typically be used for elements that change with the groups instances, for example a coloured background for a whole group. You may want to have a look at the "ImageList" example, to see how easily a report may be enhanced with these objects. Of course it is also very easy to simulate the behaviour of the DefXXX variety of commands by defining a special group, that is only flushed once per page and make use of the additional features of the GraphObjs.


Making Use of the Designer

Adding Viper Designer support to your documents

Positioning texts on a sheet of paper (or actually its digital representation) programmatically tends to be a cumbersome task. Viper's logical-lines ease some of it, but the necessity of finding the correct initial position as well as that of positioning fixed elements like table headers, footers, or company logos can still be quite annoying.

To ease all that, Viper comes with the Viper Designer. The Viper Designer allows you to easily create document templates by adding cells, graphical objects, or labels to a virtual sheet of paper, a lot like you know it from other report tools or from GUI tools like Progress' AppBuilder.

In order to make use of templates created with the Viper Designer, some additional commands need to be added to a program using Viper. These additional commands are fully integrated into Viper and are documented together with the rest of the API here. You should also have a look at the demo-application that comes with Viper. The example reports found there should be fairly instructive.

The following section will give a short account of the steps necessary to use the Designer.

1. Creating a Designer report template

The first step to create Viper Designer supported reports is of course to create a report template file (*.vfr) or a database based report definition. Details on the Designer program are given here.

  1. Start the Designer and choose the "File->new" menu entry (or click on the [image] icon).
  2. Fill out the "Report Properties" dialog. Especially choose a fitting paper size and name for the report.
  3. Now add elements to the report, either by choosing Tools->New->[Elementtype] or by right-clicking on the working area and selecting New->[Elementtype] and place the elements according to your needs. This should be fairly intuitive.
    Available element types are:

    Group | a new group definition (see. Cells And Groups and group commands)
    Cell | a new cell (see. Cells And Groups and cell commands)
    Text | a special cell that has a fixed text (i.e. a label). (see vpr_InitGroups and Designer commands)
    Rectangle, Line, and Image | graphical elements (see. graphical commands)

    You can select an element by clicking on it, dragging an element will move it around, and double-clicking will open a properties dialog.
  4. Save the report either as a *.vfd file or store it in your database (that needs to be prepared for this).
  5. Now add the necessary parts to your Viper code (or create a new program).

Following you will find some demo code. It is a slightly changed and extensively commented version of the "Some Lists" example from the demo application. It uses the report template at [VIPER-INSTALLATION-PATH]/example/vfd/sports.vfr to create a simple list, based on the the sports2000 database.

/*
 * Define a delimiter for vpr_SetGroupText
 */

&SCOPED-DEF Delimiter ~001
&SCOPED-DEF D {&Delimiter}

  {vpr.i INIT}
  {vpr.i START}

  /* Number of times to print customer. */
  DEF VAR lt-i     AS INT NO-UNDO.

  /* Load the report template that is stored in the .vfr file */
  RUN vpr_LoadVFR    ("example/vfd/sports.vfr").
  /*
   * Activate the report
   * Eventhough a .vfr file only holds a single report template, you need to
   * activate the report. This allows you to load more than one template and then
   * choose the report template that is appropriate for your current program
   * you may even change the template during the creation of a Viper report,
   * e.g. use a different template for even and odd pagenumbers.
   */
  RUN vpr_ActivateReport ("All Items").

  /* repeat everything 5 times to get a few pages */
  DO lt-i = 1 TO 5:

  /* First add the header to the page */
    RUN ShowHeader.

    /*
     * Now start to print the body of the table with the actual data from the DB,
     * looping over the "item" table
     */
    FOR EACH Item :

        /*
         * fill cells with text from the item table.
         * vpr_SetGroupText allows to set the text of a couple of cells from one
         * group at once. Sometimes this is more comfortable than a lot of "vpr_SetCellText" calls
         */
        RUN vpr_SetGroupText
            ( "Body"
             ,"Item-Num,Item-Nam,Price,On-Hand,Allocate,Cat-Page,Cat-Desc"
             ,            STRING(Item.Item-num,">>9")
               + "{&D}" + Item.Item-Name
               + "{&D}" + STRING(Item.Price, ">>>,>>9.99")
               + "{&D}" + STRING(Item.On-hand,">>>9")
               + "{&D}" + STRING(Item.Allocated,">>>9")
               + "{&D}" + STRING(Item.Cat-Page,">>>9")
               + "{&D}" + Item.Cat-Desc
             ).

        /*
         * Should we start an new page with the current item?
         * The Height of the current incarnation of the "Body" group is subtracted from
         * the remaining space on the page and the result compared to the space needed for the
         * footer. We are using a fixed value (380) here, because the footer data has not been
         * initialized, yet (this could have been done, though. Then a vpr_GetGroupHeight("Body") instead
         * of the fixed value would have worked as well.
         * For a completely different strategy to find the end point for a varying part of the report
         * have a look at the "Image List" demo, where the position of an empty and thus invisible "Stopper"
         * cell is used
         */
        IF vpr_GetPageVSpace() - vpr_GetGroupHeight("Body") < 380 THEN DO:
            /*
             * If there wasn't enough space to print the current contents of the "Body" group we need to end
             * the current page and start a new one:
             *  1. write "Footer"
             *  2. create a new page
             *  3. finally write the "Header" of the new page
             */
            RUN ShowFooter.
            RUN vpr_NewPage.
            RUN ShowHeader.
        END.
        /* "flush" the current contents of the "Body" group, i.e. add it to the page. */
        RUN vpr_FlushGroup ("Body").

    END.

    /* add the footer to the final page */
    RUN ShowFooter.

  END.

  /* tell Viper that we are done */
  RUN vpr_EndDoc.
  /* and display the preview window */
  RUN vpr_ShowPreview.

  /* Shows the header on an page. */
  PROCEDURE ShowHeader:
    /*
     * ShowHeader is the first thing done with every new page
     * So we initialize the Designer defined elements here
     */
    RUN vpr_InitGroups ("").
    RUN vpr_InitRect.
    /*
     * and then we submit the header part to the page
     */
    RUN vpr_FlushGroup ("Header1").
    RUN vpr_FlushGroup ("Header2").
  END.

  /* Shows the footer on an page. */
  PROCEDURE ShowFooter:
    RUN vpr_FlushGroup ("Footer1").
  END.


Tip for Working with Viper

A Tip for Working with Viper

Viper reads the printer configuration at the moment it is opened and uses it for page formatting and calculating free space on a given page. Later changes to the Windows printer configuration are not recognized unless you use a vpr_ResetDoc or change the printer configuration using a Viper command. Please have in mind that changes to the configuration can only be applied to new pages, pages that are already processed will not not reformatted.

Switching between compatible printers (e.g. in a network) will not cause problems. In principle, the use of true-type fonts should allow the selection of any other printer as long as the paper size remains constant, however there is no guarantee.


Viper-API

Conventions and Contents

Conventions

General form of the command descriptions:

<Viper-API-procedure-name> (Parameter 1, ..., Parameter n)

<descriptional text for the Viper procedure
or function and its parameters
...>

<mini-example>

String parameters such as cell and group names are not case sensitive. This applies to all string parameters, with the exception of text to be printed.

All size values are given in tenths of a millimeter (0.1 mm), with the exception of font height, which is, as is generally the case in typographical and word processing norms, given in points. A typographical point is 1/72 of an inch (~ 0,353 mm).

Contents

Alphabetical List of Viper commands.
Control and Setup Commands.
Document Commands .
Page Commands .
Group Commands .
Cellattribute Commands.
Graphic Commands .
Query Procedures & Functions.
Miscellaneous.
Designer Commands.


ALPHABETICAL LIST OF COMMANDS

{vpr.i} | Basic Viper include
{inc/rtf.i} | Include file to help adding rtf formats to a text.
vpr_ActivateReport | Activate a Designer report after loading.
vpr_AddToCellBuffer | Add text to a cells additional text buffer
vpr_Asc2RTF | Adds some RTF tags to normal text and escapes some control characters
vpr_DefBMP | Inserts bitmap graphic
vpr_DefCell | Defines new Cell
vpr_DefFreeLine | Draws a given line
vpr_DefHLine | Draws a horizontal line at a given position
vpr_DefHSep | Draws a horizontal line at the current cursor position (Separator)
vpr_DefRect | Draws a rectangle
vpr_DefRndRect | Draws a rectangle with rounded corners
vpr_DefVLine | Makes a vertical line
vpr_DelCell | Deletes a cell
vpr_DeleteCellBuffer | Clears the additional text buffer
vpr_DelGroups | Deletes Groups
vpr_EndDoc | Signals the end of the document to the preview (enables print-all button and preview of the last page)
vpr_ExportDoc | Exports current report in defined format (xslfo).
vpr_FetchCellHeight | Obtains the cell height
vpr_FetchCellHPos | Retrieves the horizontal position of a cell
vpr_FetchCellLineCount | Retrieves number of remaining lines in the cell
vpr_FetchCellVPos | Obtains the vertical position of a cell
vpr_FetchCellWidth | Obtains the cell width
vpr_FetchCellTextHeight | Obtains the height of the cell's text
vpr_FetchCellTextWidth | Obtains the width of the cell's text
vpr_FetchGroupHeight | Gives the group height
vpr_FetchGroupHPos | Retrieves the horizontal position of a group
vpr_FetchGroupObjects | Retrieves a list of objects of a group
vpr_FetchGroupVPos | Retrieves the vertical position of a group
vpr_FetchGroupWidth | Gives the group width
vpr_FetchPageNo | Gives the number of pages in document
vpr_FetchPageVPos | Obtains current cursor position
vpr_FetchPageVSpace | Gives an account of free space on page
vpr_FetchPreviewStatus | Waits for a given time (milliseconds) and returns the current status of the preview windows (shown or hidden/closed)
vpr_FetchPrinterAttrib | Obtain some printer attributes, by now only paperheight und -width.
vpr_FlushGroup | Prepares a group for printing
vpr_GetCellHeight | Obtains the cell height
vpr_GetCellHPos | Retrieves the horizontal position of a cell
vpr_GetCellLineCount | Retrieves number of remaining lines in the cell
vpr_GetCellTextHeigth | Returns the height of the cell's text
vpr_GetCellTextWidth | Returns the width of the cell's text
vpr_GetCellVPos | Obtains the vertical position of a cell
vpr_GetCellWidth | Obtains the cell width
vpr_GetGroupHeight | Gives the group height
vpr_GetGroupHPos | Retrieves the horizontal position of a group
vpr_GetGroupObjects | Retrieves a list of objects of a group
vpr_GetGroupVPos | Retrieves the vertical position of a group
vpr_GetGroupWidth | Gives the group width
vpr_GetPageNo | Gives the number of pages in document
vpr_GetPageVPos | Obtains current cursor position
vpr_GetPageVSpace | Gives an account of free space on page
vpr_GetPreviewStatus | Wait for a given time (milliseconds) and return the status of the preview window (shown or hidden/closed)
vpr_GetPrinterAttrib | Obtain some printer attributes, by now only paperheight und -width.
vpr_HidePreview | Closes (hides) the preview window
vpr_InitDoc | Initializes some document properties for the active report.
vpr_InitGraphObj | Initializes Designer Graphic objects.
vpr_InitGroups | Initializes Designer Groups
vpr_InitImg |
vpr_InitLin |
vpr_InitRect |
vpr_LoadDB |
vpr_LoadVFL |
vpr_LoadVFR |
vpr_NewPage | Starts a new page
vpr_OpenDoc | Loads a saved document
vpr_PrintDoc | Commences printing
vpr_PrinterDialog | Calls the standard windows printer dialog
vpr_PrintOptions | Set some printing options. By now only enables/disables the print status window
vpr_PrintPDF | Save/print a Viper document as PDF file.
vpr_PrinterSetup | Calls the printer setup dialogue
vpr_RemoveReport |
vpr_ResetDoc | Deletes the current document
vpr_SaveClipboardToFile | Save the (graphical) contents of the clipboard to a file.
vpr_SaveDoc | Saves a viper document
vpr_SaveWindowToFile | Save a given window to a file.
vpr_SelectPrinter | Selects the printer using the windows printer name
vpr_SetCellAlign | Aligns the text in a cell
vpr_SetCellAutoResize | Corresponds cell height to text length
vpr_SetCellBuffer | Set the additional textbuffer of a cell.
vpr_SetCellCodePage | Sets the codepage for the given cell
vpr_SetCellColor | Sets the fore- and backgroundcolor of a cell
vpr_SetCellFont | Sets font for a cell
vpr_SetCellHeight | Sets a cells height
vpr_SetCellLongText | Sets the text to be printed by a cell (LONGCHAR version)
vpr_SetCellPos | Defines the position and size of a cell
vpr_SetCellRotation | Set the rotation angle for a cell's text
vpr_SetCellRTF | Turn RTF mode on or off for the given cell.
vpr_SetCellSplit | Enable a cell to print its contents distributed over several instances (i.e. several vpr_FlushGroup commands), thus enabling you to print long text distributed over several pages.
vpr_SetCellText | Sets the text to be printed by a cell
vpr_SetCellWrap | Sets autowrapping-mode for a cell
vpr_SetCurrentPageProperties | Set certain properties on a per page basis, e.g. the paper bin.
vpr_SetDelimiter | Sets the delimiter used internally by viper and for the vpr_SetGroupText command
vpr_SetDocAttrib | Sets some document specific attributes.
vpr_SetDocTitle | sets the document title shown in the windows printer queue
vpr_SetGraphObj | Create a graphical object of a given type that belongs to a given group.
vpr_SetGraphObjAttrib | Sets the attributes of the specified graphical object
vpr_SetGroupAttrib | Sets some group attributes.
vpr_SetGroupCellPositioning | Enables the group to retain the cells relative positions in the group after a vpr_FlushGroup.
vpr_SetGroupSkip | Defines the free space before and after a logical line of a group
vpr_SetGroupText | Sets the text for several cells of a group
vpr_SetGroupVPos | Sets the vertical position of a whole group
vpr_SetPageOrientation | Sets the print-orientation of a document.
vpr_SetPageVPos | Sets the current vertical position
vpr_SetPaperSize | Sets the documents paper size.
vpr_SetPreviewMode | Sets the previewmode for VIPER.
vpr_SetPrinterAttrib | Sets several attributes of the printout (copies, from and to pages, prin to file and filename)
vpr_SetPrinterDialogMode | Selects whether the print-button calls the print dialog prior to printing.
vpr_SetTempDir | Sets the temporary directory used by Viper
vpr_SetWindowPos | Sets the position and size of the preview window
vpr_ShowDoc | Shows preview persistently.
vpr_ShowPreview | Activates (shows) the preview window
vpr_SubmitCellBuffer | Copy the contents of the cells additional buffer into the cell text
vpr_ToRTF | Convert string to RTF sequence.
vpr_WebPrintDoc | Some support to print a viper document as a webpage. (only for integration with Webspeed)


{vpr.i}
The vpr.i interface include file gets included in applications that use Viper for printing. The code to be included is defined by preprocessor variables.

USAGE:

[{
[&SCOPED-DEFINE | &SCOP]
    [	 vpr_mode 				[START|STOP]
         |   vpr_init				[YES | else]
         |	 vpr_start				[YES | else]
         |	 vpr_stop				[YES | else]
         |  [vpr_handle          | vpr_hd   ]	handlename
         |  [vpr_function_header | vpr_fcthd]	[YES | else]
         |	[vpr_define_handle   | vpr_dhd  ]	[YES | else]
         |	[vpr_input_param     | vpr_ipr	]	[YES | else]
         |	[vpr_shared_handle   | vpr_shd  ]	[|shared|new shared|new global shared]
         |	[vpr_run_super       | vpr_sup  ]	[YES | else]
         |	[vpr_add_super_at    | vpr_sat  ]	handle
} ...]
{vpr.i [ START | STOP | INIT | [input_param | inpar] | [function_header | fcthd] | [define_handle | defhd] ]}
}

START/STOP:

&SCOP vpr_run_super NO 		Set to NO if viper.p should not be started as super-procedure (using V9)
{vpr.i}

&SCOP vpr_add_super_at handle	Sets handle to which viper.p should be added as super-pürocedure (default is THIS-PROCEDURE)
{vpr.i}

&SCOP vpr_mode  START		Runs viper.p persistently and defines (if using ProgressV9) by default
{vpr.i}				viper.p as super procedure.
    OR
&SCOP vpr_start	YES
{vpr.i}
    OR
{vpr.i START}

&SCOP vpr_mode  STOP		Removes viper.p and viper.dll from memory.
{vpr.i}
    OR
&SCOP vpr_stop	YES
{vpr.i}
    OR
{vpr.i STOP}

INITIALIZE/DEFINE:

&SCOP vpr_handle handlename	Sets name of handle variable that points to viper.p.
{vpr.i}

&SCOP vpr_shared_handle val	May be used for defining {&vpr_handle} as shared.
{vpr.i}

&SCOP vpr_define_handle	YES	Defines handle variable named {&vpr_handle}.
{vpr.i}
    OR
{vpr.i define_handle}

&SCOP vpr_input_param	YES	Defines input parameter variable named {&vpr_handle}.
{vpr.i}
    OR
{vpr.i input_param}

&SCOP vpr_function_header YES	Declares function headers of Viper functions.
{vpr.i}
    OR
{vpr.i function_header}

&SCOP vpr_init	YES		Defines handle variable named {&vpr_handle},
{vpr.i}				and declares function headers of Viper functions.
    OR
{vpr.i INIT}

EXAMPLES:

main.p
------
{vpr.i INIT}
{vpr.i START}

RUN sub.p (INPUT {&vpr_handle}, INPUT 2)

{vpr.i STOP}

sub.p
-----
{vpr.i input_param}
DEF INPUT PARAM l-int AS INT.

{vpr.i function_header}

/* use some viper functions */
run vpr_...(...).

RETURN.


Viper - embedded formats

To help you formatting your texts with rtf tags there is an include file called rtf.i. It works like a function and allows commands like: RUN vpr_SetCellText ("cell", "group", "This text is " + { rtf.i "bold,italic" "bold and italic." }).

Syntax: {rtf.i "formatstring" "Text"}
Formatstring is a commaseparated list of formatting tags.
Tags currently supported:

Note: This only works for string literals

Note: This include file is deprecated. Use vpr_ToRTF instead.

commmand
bold
italic
underline
strike

see also: vpr_Asc2RTF and vpr_ToRTF


Viper Designer - vpr_ActivateReport

vpr_ActivateReport | (CHAR ReportName)

This procedure activates one of the loaded reports. It sets the report named ReportName as current report.
This report must be loaded into Viper with one of the "vpr_LoadXXX" commands first.

Call:
 RUN vpr_ActivateReport ("Invoice 1").


vpr_AddToCellBuffer

vpr_AddToCellBuffer (CHAR CellName, CHAR GrpName, CHAR Text)

Appends Text to the additional text buffer of CellName.

The additional buffer is only affected by CellBuffer-commands and not by vpr_FlushGroup or other commands. It keeps its contents until deleted with vpr_DeleteCellBuffer. This enables for example the saving of interim values or things alike which can be used later. It is also used for processing long text, because text of any length can be added to the CellBuffer.

Call:
RUN vpr_AddToCellBuffer ("Pos","Hdr"," And just a little more of it").


vpr_Asc2RTF

vpr_Asc2RTF (CHAR InString, CHAR Attribs, OUTPUT CHAR OutString)

Adds the given attributes to InString and escapes some RTF control sequences. Attribs is a comma separated list with wrapper attributes. OutString gives the transformed string.
Attributes: bold, italic, underline, strike

Example:
     DEF VAR StrikeText AS CHAR NO-UNDO INIT "".
     RUN vpr_Asc2RTF  ("wrong","strike",OUTPUT StrikeText).
     RUN vpr_SetCellText  ("c1","g1","This is " + StrikeText + ".").

see also: vpr_ToRTF and rtf.i


VIPER Designer

vpr_DelGroups | (CHAR GroupList)

This command deletes the cells of a list of groups. The group names must be separated with commas.
If GroupList is empty every cell in every group in the report will be deleted.

This command is used to get rid of groups that are not longer wanted. You may not know which cells are in group, but the command knows. After that, you can fill the group again with new cells.

example:
RUN vpr_DelGroups ("Header1,Header2").


vpr_DefBMP

vpr_DefBMP (CHAR filename, INT left, INT top, INT width, INT height, CHAR mode)

Inserts a graphic into the document on the current page. Currently supported formats are: Windows Bitmaps (*.bmp and *.dib), JPEG (*.jpg and *.jpeg), and Windows (Aldus) MetaFiles (*.wmf and *.emf)

Parameter | Meaning
filename | Path and file name of the .BMP-file.
left | Left positioning of the graphic on the page.
top | Top positioning of the graphic on the page.
width | maximum width of the Bitmap, when adjusted.
height | maximum height of the Bitmap, when adjusted.
mode A comma delimited list, that tells Viper the display modes:
Resize/NoResize | Should the image be resized to fit the values given by left, top, width, height? Defaults to NoResize.
KeepRatio/NoKeepRatio | If "Resize" is given, should the aspect ratio of the image be retained or should the image in all directions be stretched to the given values? Default is "NoKeepRatio"
The parameter defaults to "NoResize".

Call:
RUN vpr_DefBMP ("c:\windows\winlogo.bmp",50,50,1000,1000,"Resize,KeepRatio").

Imports the Bitmap graphic in c:\windows\winlogo.bmp and allows 5 mm to the left and under the border. The picture will, when page properties are retained, be applied to an area of 10cm * 10cm.
The Bitmap-files will be reloaded at every drawing and every printing.

Note: Images added with vpr_DefBMB are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead put on the page directly.

For images and other graphical objects that are bound to groups see vpr_SetGraphObj and vpr_SetGraphObjAttr statements.


vpr_DefCell

vpr_DefCell (CHAR CellName, CHAR GrpName)

Creates the cell CellName in the group GrpName.

Note: All commands that apply to a fixed cell, create this cell automatically, assuming it does not yet exist, thus it is not necessary to use DefCell.

Defaults for cells:

  • Font: Times New Roman, normal, 12 point;
  • Text aligned left;
  • Automatic correspondence of cell height to text.
  • Cell width=0 (the Coordinates of the cell must be defined once!)
  • Left position on left border
  • Upper border correlates to group

Call:
RUN vpr_DefCell ("Pos","Hdr").


vpr_DefFreeLine

vpr_DefFreeLine (INT x, INT y, INT x1, INT y1, CHAR style, INT Width, CHAR col)

Draws a line of the color col from x,y to x1,y1.

Color coding:
The colors are given as a character string. There a two possible forms of this string. The first one s a comma seperated list that gives the values for the colors as "red, green, blue", whereby red, green, and blue represent numbers from 0 (null) to 255 for the respective colors. The color saturation intensifies as the values are increased.
The second way of determining the color is to give the colornames used up to Progress Version 6. These are:

"Light-Gray"
"Gray"
"Dark-Gray"
"Black"
"White"
"Blue"
"Light-Blue"
"Green"
"Light-Green"
"Cyan"
"Light-Cyan"
"Red"
"Light-Red"
"Magenta"
"Light-Magenta"
"Brown"
"Light-Brown"
"Yellow"
"Light-Yellow"

The actual color representation when printing however, is dependant on the restrictions of the printer and the driver.

Style can assume the following values:

Style | Meaning
Solid | unbroken line
Dash | broken line
Dot | dotted line
DashDot | dot followed by dash repeated
DashDotDot | -.. and so on...

The default value is solid.

Width is only supported in the solid mode. Giving a width other than 1 in any other mode may lead to unexpected and unwanted results.

call:
RUN vpr_DefFreeLine (50,50,200,400,"Solid",3,"black").
(a diagonal solid line (0,3mm) in black.)

Note: These objects are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.


vpr_DefHLine

vpr_DefHLine (INT x, INT y, INT len, CHAR Style, INT width, CHAR col)

Horizontal line with length len. Otherwise like vpr_DefFreeLine.

Call:
RUN vpr_DefHLine (50,50,200,"solid",5,"black").
A black, horizontal line at a position 5mm from the upper left corner, 20mm long and 0.5 mm wide.

Note: The graphic objects are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.


vpr_DefHSep

vpr_DefHSep (INT len, INT justify, INT style, INT width, CHAR col)

Horizontal separator (line) at the current cursor position.
Width gives the length in steps of 0.1mm, col gives the color as explained at color-coding.
Style has the same meaning as by other graphic objects.
The parameter justify determines the position of the seperator on the paper.

justify | meaning
Fill | total page width (ignores parameter len)
Left | left oriented
Right | right oriented
Center | centered

call:
RUN vpr_DefHSep (1000,"center","solid",5,"BLACK").
(A 10cm long, 0.5mm wide, centered, black line at the current cursor position.)

Note: These objects are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.


vpr_DefRect

vpr_DefRect (INT x, INT y, INT width, INT height, CHAR filled, CHAR col)

Creates a rectangle with the upper left corner at x, y; The Parameter width and height control the size of the rectangle.

The color given by col.(see color coding).

filled fills the rectangle if it is one of "fill", "filled", "true".

Call:
RUN vpr_DefRect (50,50,200,400,"fill","128,128,128").

Note: These objects are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.
Rectangles are generated downward on the paper.


vpr_DefRndRect

vpr_DefRndRect (INT left, INT top, INT width, INT height, INT filled, CHAR col)

Like vpr_DefRect(), but with rounded corners.
Creates a rectangle with rounded corners and the upper left corner at left, top; The Parameter width and height control the size of the rectangle.

The color given by col.(see color coding).

filled fills the rectangle if it is one of "fill", "filled", "true".

Call:
RUN vpr_DefRndRect (50,50,200,400,"","128,128,128").

Note: The objects are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.
Rectangles are generated downward on the paper.


vpr_DefVLine

vpr_DefVLine (INT x, INT y, INT len, CHAR Style, INT width, CHAR col)

A vertical line with length len, otherwise like vpr_DefFreeLine.

Call:
RUN vpr_DefVLine (50,50,200,"solid",5,"black").
A black, vertical line at a position 5mm from the upper left corner, 20mm long and 0.5 mm wide.

Note: The lines are not attached to a group or cell, and are therefore not controlled from vpr_FlushGroup, but are instead printed directly.


vpr_DelCell

vpr_DelCell (CHAR CellName, CHAR GrpName)

Deletes GrpName in the Group and CellName in the cell. Using a "*" as cellname will delete all cells of the given group.

call:
RUN vpr_DelCell ("*","Hdr").


vpr_DeleteCellBuffer

vpr_DeleteCellBuffer (CHAR CellName, CHAR GrpName)

Clears the additional text buffer.
The additional buffer is only affected by CellBuffer-commands and not by vpr_FlushGroup or other commands. It keeps its contents until it is deleted with vpr_DeleteCellBuffer. This enables for example the saving of interim values or things alike which can be used later. It is also used for processing long text, because text of any length can be added to the CellBuffer.

call:
RUN vpr_DeleteCellBuffer ("Pos","Hdr").


vpr_EndDoc

Tells the preview, that the current document has ended. Enables viewing of the current (=last) page and activates the Print all-button.

Call:
RUN vpr_EndDoc .


vpr_ExportDoc

vpr_ExportDoc | (int From, | int To, | char Filename, | char Type)

Exports defined pages (from,to) of a viper document under the given Filename in defined format (Type). With from=0, to=0 all pages are printed. Currently type "xslfo" is supported, generating documents in XSL formatting objects format.

call:
RUN vpr_ExportDoc (0,0,"MyReport.fo","xslfo").


vpr_GetCellHeight

vpr_FetchCellHeight (CHAR CellName, CHAR GrpName, OUTPUT INT height)

After the function call, height contains the height of the (not yet flushed) cell CellName with its current text and attributes in units of 0.1 mm.

call:
RUN vpr_FetchCellHeight ("Pos", "Hdr", OUTPUT retHeight).


vpr_GetCellHPos

vpr_FetchCellHPos (char cell, char group, OUTPUT int HPos)

HPos gives back the horizontal position of cell.

call:
RUN vpr_FetchCellHPos ("myCell", "myGroup", OUTPUT HPos).


vpr_GetCellLineCount

vpr_FetchCellLineCount | (CHAR cell, CHAR group, OUTPUT INT LineCount)

LineCount returns the number of remaining lines in the cell, if the RTF attribute and the split attribute are set. In conjunction with vpr_SetCellSplit this enables you to print the contents of a cell split on several pages (actually several instances of the cell, separated by vpr_FlushGroup). After a vpr_FlushGroup you can query the number of lines still in the cell.

call:
RUN vpr_FetchCellLineCount ("myCell", "herGroup", OUTPUT LineCount).


vpr_GetCellVPos

vpr_FetchCellVPos (char cell, char group, OUTPUT int VPos)

The vertical position of the cell cell in the group group is retrieved and given back in VPos.

call
RUN vpr_FetchCellVPos ("myCell", "MyGroup", OUTPUT VPos).


vpr_GetCellWidth

vpr_FetchCellWidth (CHAR CellName, CHAR GrpName, OUTPUT INT Width)

After the function call, Width contains the width of the (not yet flushed) cell CellName in units of 0.1 mm.

call:
RUN vpr_FetchCellWidth ("Pos", "Hdr", OUTPUT retWidth).


vpr_FetchCellTextHeight

vpr_FetchCellTextHeight (CHAR CellName, CHAR GrpName, OUTPUT INT Height)

After the procedure call, Height contains the height of the text of the (not yet flushed) cell CellName in units of 0.1 mm.

This function differs from vpr_FetchCellHeight: it returns the height that is needed to display the cells text. This may be considerably smaller than the result of vpr_GetCellHeight. For example, the following code prints different values:

{vpr.i INIT}
{vpr.i START}

DEFINE VARIABLE cellHeight AS INT NO-UNDO.
DEFINE VARIABLE cellTextHeight AS INT NO-UNDO.

RUN vpr_SetCellPos("cell", "group", 10, 10, 1000, 200).
RUN vpr_SetCellText("cell", "group", "Hello").
RUN vpr_FetchCellHeight("cell", "group", OUTPUT cellHeight)
RUN vpr_FetchCellTextHeight("cell", "group", OUTPUT cellTextHeight)
MESSAGE "CellHeight: " + STRING(cellHeight).
MESSAGE "CellTextHeight: " + STRING(cellTextHeight).

{vpr.i STOP}

Output:

CellHeight: 200
CellTextHeight: 46

call:
RUN vpr_FetchCellTextHeight ("Pos", "Hdr", OUTPUT Height).


vpr_FetchCellTextWidth

vpr_FetchCellTextWidth (CHAR CellName, CHAR GrpName, OUTPUT INT Width)

After the procedure call, Width contains the width of the text of the (not yet flushed) cell CellName in units of 0.1 mm.

This procedure differs from vpr_FetchCellWidth: it returns the width that is needed to display the cells text. This may be considerably smaller than the result of vpr_GetCellWidth. For example, the following code shows the difference:

{vpr.i INIT}
{vpr.i START}

DEFINE VARIABLE cellWidth AS INT NO-UNDO.
DEFINE VARIABLE cellTextWidth AS INT NO-UNDO.

RUN vpr_SetCellPos("cell", "group", 10, 10, 1000, 0).
RUN vpr_SetCellText("cell", "group", "Hello~rHello").
RUN vpr_FetchCellWidth("cell", "group", OUTPUT cellWidth)
RUN vpr_FetchCellTextWidth("cell", "group", OUTPUT cellTextWidth)
MESSAGE "CellWidth: " + STRING(cellWidth).
MESSAGE "CellTextWidth: " + STRING(cellTextWidth).

{vpr.i STOP}

Output:

CellWidth: 1000
CellTextWidth: 94

call:
RUN vpr_FetchCellTextWidth ("Pos", "Hdr", OUTPUT Width).


vpr_GetGroupHeight

vpr_FetchGroupHeight (CHAR GrpName, OUTPUT INT GrpHeight)

Returns the height if the group GrpName in GrpHeight. The height of the group is defined by the topmost and lowest positions of all cells (using there current [pre-flush] text values]) in the group.

Call:
RUN vpr_FetchGroupHeight ("Hdr",OUTPUT retHeight).


vpr_GetGroupHPos

INT HPos = vpr_GetGroupHPos (char group)

vpr_FetchGroupHPos (char group, OUTPUT INT HPos)

Obtains the horizontal position of group and gives it back in HPos.

call:
HPos = vpr_GetGroupHPos ("myGroup").

RUN vpr_FetchGroupHPos ("myGroup", OUTPUT HPos).


vpr_GetGroupObjects

CHAR objnames = vpr_GetGroupObject (CHAR GrpName, CHAR ObjectType)

vpr_FetchGroupObject (CHAR GrpName, CHAR ObjectType, OUTPUT CHAR objnames)

Returns a comma separated list of the names of the objects of type "ObjectType" in group "GrpName". The maximum length of the list is 31999 characters.

Valid object types are:

Cell | For viper's (text) cells
Rect, RndRect, or Line | for _all_ graphical objects except for images, that belong to the group
Bmp or Image | for the images belonging to the given group
(empty string) | all objects regardless of their type

Call:
Objects = vpr_GetGroupObjects("Hdr", "CeLL").

RUN vpr_FetchGroupObjects("Hdr", "CeLL", OUTPUT Objects).


vpr_FetchGroupVPos

vpr_FetchGroupVPos (char group, OUTPUT int VPos)

Obtains the vertical position of group and gives it back in VPos.

Call:
RUN vpr_FetchGroupVPos ("myGroup", OUTPUT VPos).


vpr_GetGroupWidth

INT GrpWidth = vpr_GetGroupWidth (CHAR GrpName)

vpr_FetchGroupWidth (CHAR GrpName, OUTPUT INT GrpWidth)

Returns the width if the group GrpName in GrpWidth. The width of the group is defined by the leftmost and rightmost positions of all cells in the group.

Call:
Width = vpr_GetGroupWidth ("Hdr").

RUN vpr_FetchGroupWidth ("Hdr", OUTPUT Width).


vpr_GetPageNo

vpr_FetchPageNo | (OUTPUT INT pages)

Gives a count of the pages. (this will be the same number as the current page)

Call:
RUN vpr_FetchPageNo (OUTPUT retPages).


vpr_GetPageVPos

vpr_FetchPageVPos | (OUTPUT INT vertPos)

gives the current vertical position in vertPos (relative to the beginning of the page).

Call:
RUN vpr_FetchPageVPos (OUTPUT retVertPos).


vpr_FetchPageVSpace

vpr_FetchPageVSpace | (OUTPUT INT free)

Transfers free space on the current page to free (based on the currently flushed cells/groups)

Call:
RUN vpr_FetchPageVSpace (OUTPUT retFree).


vpr_FetchPreviewStatus

vpr_FetchPreviewStatus (INT timeout OUTPUT CHAR status)

Set "status" to the current preview status. You can use this to find out, if the preview window has been closed by the user.

timeout is the time viper waits before it returns. It is given in milliseconds.

Return value | Meaning
visible | The preview is currently shown
hidden | The preview is not shown (for example because it has been closed by the user.)

call:
vpr_FetchPreviewStatus(1000, OUTPUT lp-status).

example:
/* wait until the user has closed the preview window. */
{vpr.i init}
{vpr.i start}

RUN vpr_setcelltext("c","g","Hi!").
RUN vpr_flushgroup("g").
RUN vpr_enddoc.
RUN vpr_ShowPreview.

/*
 * here we wait! Make sure the timeout is high enough to give Viper
 * the chance to follow the users actions fast enough
 */
DEFINE VARIABLE status AS CHARACTER NO-UNDO INIT "".
DO WHILE status <> "visible":
      vpr_FetchPreviewStatus(1000, OUTPUT status).
END.

/*
 * ok. preview has been closed. stop viper. or do some other stuff :-)
 */
{vpr.i stop}


vpr_FetchPrinterAttrib

vpr_FetchPrinterAttrib (CHAR attrib, OUTPUT CHAR value)

Uses value to return the value of the attribute given in attrib So far the attributes paperwidth and paperheight are supported.

Call:
RUN vpr_FetchPrinterAttrib ("Paperwidth", OUTPUT PWidth).


vpr_FlushGroup

vpr_FlushGroup | (CHAR GrpName)

"Flushes" the contents of a group and its cells to the current page. Then the cell contents are deleted and the group is repositioned one logical line lower.

This command has an integral function in Viper. Only after the vpr_FlushGroup command are the current contents of a cell in a group available for printing. Also, vpr_FlushGroup positions cells in a group in such a way that, during the next execution, they start underneath the lowest previous position of the cell in this group and thus create the logical lines.
Also see: vpr_SetGroupCellPositioning

Call:
RUN vpr_FlushGroup ("Hdr").


vpr_GetCellHeight

INT Height = vpr_GetCellHeight (CHAR CellName, CHAR GrpName)

After the function call, height contains the height of the (not yet flushed) cell CellName with its current text and attributes in units of 0.1 mm.

call:
height = vpr_GetCellHeight ("Pos", "Hdr").


vpr_GetCellHPos

INT HPos = vpr_GetCellHPos (char cell, char group)

HPos gives back the horizontal position of cell.

call:
HPos = vpr_GetCellHPos ("myCell", "myGroup").


vpr_GetCellLineCount

INT LineCount = vpr_GetCellLineCount | (CHAR cell, CHAR group)

LineCount returns the number of remaining lines in the cell, if the split attribute is set. In conjunction with vpr_SetCellSplit this enables you to print the contents of a cell split on several pages (actually several instances of the cell, separated by vpr_FlushGroup). After a vpr_FlushGroup you can query the number of lines still in the cell.

call:
LineCount = vpr_GetCellLineCount ("myCell", "herGroup).


vpr_GetCellTextHeight

INT Height = vpr_GetCellTextHeight (CHAR CellName, CHAR GrpName)

After the function call, Height contains the height of the text of the (not yet flushed) cell CellName in units of 0.1 mm.

This function differs from vpr_GetCellHeight: it returns the height that is needed to display the cells text. This may be considerably smaller than the result of vpr_GetCellHeight. For example, the following code:

{vpr.i INIT}
{vpr.i START}

RUN vpr_SetCellPos("cell", "group", 10, 10, 1000, 200).
RUN vpr_SetCellText("cell", "group", "Hello").
MESSAGE "CellHeight: " + STRING(vpr_GetCellHeight("cell", "group")).
MESSAGE "CellTextHeight: " + STRING(vpr_GetCellTextHeight("cell", "group")).

{vpr.i STOP}

Output:

CellHeight: 200
CellTextHeight: 46

call:
Height = vpr_GetCellTextHeight ("Pos", "Hdr").


vpr_GetCellTextWidth

INT Width = vpr_GetCellTextWidth (CHAR CellName, CHAR GrpName)

After the function call, Width contains the width of the text of the (not yet flushed) cell CellName in units of 0.1 mm.

This function differs from vpr_GetCellWidth: it returns the width that is needed to display the cells text. This may be considerably smaller than the result of vpr_GetCellWidth. For example, the following code:

{vpr.i INIT}
{vpr.i START}

RUN vpr_SetCellPos("cell", "group", 10, 10, 1000, 0).
RUN vpr_SetCellText("cell", "group", "Hello~rHello").
MESSAGE "CellWidth: " + STRING(vpr_GetCellWidth("cell", "group")).
MESSAGE "CellTextWidth: " + STRING(vpr_GetCellTextWidth("cell", "group")).

{vpr.i STOP}

Output:

CellWidth: 1000
CellTextWidth: 94

call:
Width = vpr_GetCellTextWidth ("Pos", "Hdr").


vpr_GetCellVPos

INT VPos = vpr_GetCellVPos (char cell, char group)

The vertical position of the cell cell in the group group is retrieved and given back in VPos.

Call
VPos = vpr_GetCellVPos ("myCell", "MyGroup").


vpr_GetCellWidth

INT Width = vpr_GetCellWidth (CHAR CellName, CHAR GrpName)

After the function call, Width contains the width of the (not yet flushed) cell CellName in units of 0.1 mm.

call:
Width = vpr_GetCellWidth ("Pos", "Hdr").


vpr_GetGroupHeight

INT GrpHeight = vpr_GetGroupHeight (CHAR GrpName)

Returns the height if the group GrpName in GrpHeight. The height of the group is defined by the topmost and lowest positions of all cells (using there current [pre-flush] text values]) in the group.

Call:
Height = vpr_GetGroupHeight ("Hdr").


vpr_GetGroupVPos

INT VPos = vpr_GetGroupVPos (char group)

Obtains the vertical position of group and gives it back in VPos.

call:
VPos = vpr_GetGroupVPos ("MyFavouriteThings").


vpr_GetPageNo

INT pages = vpr_GetPageNo | ()

Gives a count of the pages. (this will be the same number as the current page)

call:
Pages = vpr_GetPageNo ().


vpr_GetPageVPos

INT vertPos = vpr_GetPageVPos | ()

gives the current vertical position in vertPos (relative to the beginning of the page).

Call:
VertPos = vpr_GetPageVPos ().


vpr_GetPageVSpace

INT free = vpr_GetPageVSpace | ()

Transfers free space on the current page to free (based on the currently flushed cells/groups)

Call:
Free = vpr_GetPageVSpace ().


vpr_GetPreviewStatus

CHAR status = vpr_GetPreviewStatus (INT timeout)

Returns the current preview status. You can use this to find out, if the preview window has been closed by the user.

timeout is the time viper waits before it returns. It is given in milliseconds.

Return value | Meaning
visible | The preview is currently shown
hidden | The preview is not shown (for example because it has been closed by the user.)

call:
status = vpr_GetPreviewStatus(1000).

example:
/* wait until the user has closed the preview window. */
{vpr.i init}
{vpr.i start}

RUN vpr_setcelltext("c","g","Hi!").
RUN vpr_flushgroup("g").
RUN vpr_enddoc.
RUN vpr_ShowPreview.

/*
 * here we wait! Make sure the timeout is high enough to give Viper
 * the chance to follow the users actions fast enough
 */
DO WHILE vpr_GetPreviewStatus(1000)="visible". END.

/*
 * ok. preview has been closed. stop viper. or do some other stuff :-)
 */
{vpr.i stop}


vpr_GetPrinterAttrib

CHAR value = vpr_GetPrinterAttrib (CHAR attrib)

Uses value to return the value of the attribute given in attrib So far the attributes paperwidth and paperheight are supported.

call:
PWidth = INTEGER(vpr_GetPrinterAttrib ("Paperwidth")).


vpr_HidePreview

Hides the preview window. vpr_ShowPreview can show the window again.

call:
RUN vpr_HidePreview .

Note: vpr_HidePreview works regardless of the selected preview mode.

Also note, that vpr_HidePreview does not work for documents shown with vpr_ShowDoc


Viper Designer - vpr_InitDoc

vpr_InitDoc

Initializes some document properties as defined in the currently active report (see. vpr_ActivateReport). This is done implicitely when you activate the report, but you need to redo it after issuing a vpr_SelectPrinter statement. Most notably it sets the paper size and orientation.

Call:
RUN vpr_InitDoc.


Viper Designer - vpr_InitGraphObj

vpr_InitGraphObj

This procedure initializes all graphical objects of the currently active report (activated by calling vpr_ActivateReport) that don't belong to a group. It is absolutely the same as calling "vpr_InitRect", "vpr_InitLin" and "vpr_InitImg" one by one (and that's what it does).

example:
RUN vpr_InitGraphObj.


VIPER Designer

vpr_InitGroups | (CHAR GroupList)

This command realizes the cells of a list of groups. The group names must be separated with a ','.
If GroupList is empty every group in the report will be realized.

This command should only be called once for every group. After the first realization of the group, it will again be on the same place with the same set attributs on every page (see Viper documentation for group behavior). To call this command on every page will decrease the performance of your reports.
A cell which is realized will get all settings which are defined (size, position, font etc.), but still remain empty.
A 'text' will also get all settings and is filled with its value (which had been defined in the Designer).
Lines which are in groups are also realized. But lines are still not really bound to groups. After filling again a group, you will not get a new line.

example:
RUN vpr_InitGroups ("Header1,Header2").


VIPER Designer

vpr_InitImg

This procedure initializes all images of the current loaded report. Images are not in a group, so they are realized all together.

example:
RUN vpr_InitImg.


VIPER Designer

vpr_InitLin

This procedure initializes all those lines of the current loaded report which not belong to a group (The lines are not really in a group, the group only gives you the possibility to realize some lines only when realizing a special group).

example:
RUN vpr_InitLin.


VIPER Designer

vpr_InitRect

This procedure initializes all rectangles of the current loaded report. Rectangles are not in a group, so they are realized all together.

example:
RUN vpr_InitRect.


VIPER Designer

vpr_LoadDB | (CHAR ReportName)

This procedure loads reports from connected database into memory. It loads the report named ReportName defined in the vpr_-tables of a connected database into Viper. (In the vprdb subdirectory of the Viper installation there is a df file and additional information on the structure of the vpr_-tables).

example:
 RUN vpr_LoadDB ("Invoice1").


VIPER Designer

vpr_LoadVFL | (CHAR FileName)

This procedure loads reports generated with old Viper Frame Designer (distributed with Viper2.44) into memory. It loads all reports defined in .vfl-file where FileName points to into Viper.

example:
 RUN vpr_LoadVFL ("c:\temp\myreports.vfl").


VIPER Designer

vpr_LoadVFR | (CHAR FileName)

This procedure loads reports generated with Viper Designer (distributed with Viper3.0) into memory. It loads the report defined in .vfr-file where FileName points to into Viper.

example:
 RUN vpr_LoadVFR ("c:\temp\myreports.vfr").


vpr_NewPage

Creates a new page, which becomes the current page. The previous page can no longer be edited.

After a vpr_NewPage the positions of the cells are reset to the value given by the last vpr_SetCellPos. In this way e.g. the position of headers has to be set only once, on all following pages a vpr_FlushGroup is sufficient to print the header. For a simple list the starting values of logical lines may not need to be set again, as well.

Note: It is not necessary to call vpr_NewPage after the last page. This only prints a blank page.

Call:
RUN vpr_NewPage .


vpr_OpenDoc

vpr_OpenDoc | (char Filename)

Loads a viper document that has been saved using vpr_SaveDoc from the file Filename. This document can be printed or the report can be extended.

call:
RUN vpr_openDoc ("MyReport.vpr").


vpr_PrintDoc

vpr_PrintDoc (INT from, INT to)

Starts the actual printing. From and to specify the first and last pages to be printed. With from=0, to=0 all pages are printed. vpr_PrintDoc works independent from if the preview is activated or not. Only in the Direct print mode no document is specified so that only the current page is printed by PrintDoc.

call:
RUN vpr_PrintDoc (0,0).


vpr_PrinterDialog

vpr_PrinterDialog | (OUTPUT LOGICAL button)

Calls the standard printer dialog. You can change the printer and choose which pages to print.

The output-parameter button returns the button, that was pressed to end the dialog. Its value is the same as given by Progress' System-Dialog Printer-Setup: TRUE stands for the OK-Button and FALSE shows that the dialog was canceled.
The entered values are the new defaults for printing, thus issueing a RUN vpr_PrintDoc (0,0) prints the document as requested by the user, while a RUN vpr_PrintDoc (1,2) prints the first two pages.

call:
RUN vpr_PrinterDialog (OUTPUT whichButton).


vpr_PrinterSetup

Calls the printer setup dialog. You can change the printer and several properties (e.g. papersize or paper tray).

call:
RUN vpr_PrinterSetup .


vpr_PrintOptions

vpr_PrintOptions ("ShowPrintStatus", "Off|On|NoCancel"; "" "" "")

PrintOption determines the behaviour of the printing status window.

On | Normal status window while printing
Off | No status window while printing
NoCancel | Status window enabled, but no cancel button

call:
RUN vpr_PrintOptions ("ShowPrintStatus","Off","","","").


vpr_PrintPDF

vpr_PrintPDF (INT from, INT to, INPUT-OUTPUT CHAR filename)

This command prints a document to a PDF file. From and to specify the first and last pages to be printed. With from=0, to=0 all pages are printed.
Filename gives the name of the file to be printed to. If filename is an empty string Viper uses a temporary filename and returns it in filename
Please see the section Viper Setup for some details on how to setup Viper for PDF printing!

call:

DEF VAR fnam AS CHAR NO-UNDO INIT "".
RUN vpr_PrintPDF  (0,0, INPUT-OUTPUT fnam).


VIPER Designer

vpr_RemoveReport | (CHAR ReportName)

This procedure removes loaded reports from memory . It removed the report named ReportName from Viper access.
This report must be loaded into Viper with one of the "vpr_LoadXXX" commands first.

example:
 RUN vpr_RemoveReport ("Invoice 1").


vpr_ResetDoc

Resets Viper. All pages in the current document are deleted. Viper is ready to print a new document.
Tip: During a vpr_ResetDoc, the printer configurations are read anew, so that changes in configuration are possible after printing and before starting a new document.

call:
RUN vpr_ResetDoc .


vpr_SaveClipboardToFile

vpr_SaveClipboardToFile (CHAR type, CHAR FileIn OUTPUTCHAR FileOut)

saves the clipboard contents to a file (currently only BMP and DIB, no text and, naturally, no sounds or other stuff).

Parameter |
type | So far only "BMP" and "DIB" are supported. I.e. only graphics are supported.
FileIn | File name to save it to. If no filename is given a temporary name will be used.
FileOut | The filename actually used. If the operation was not successfull it is an empty string.

Call:
RUN vpr_SaveClipboardToFile ("BMP","",OUTPUT tempnam).


vpr_SaveDoc

vpr_SaveDoc | (char Filename)

Saves a viper document under the given Filename. This document can be loaded using vpr_OpenDoc and can be printed again.

call:
RUN vpr_SaveDoc ("MyReport.vpr").


vpr_SaveWindowToFile

vpr_SaveWindowToFile (INT WindowHandle, CHAR AreaType, CHAR FileIn OUTPUTCHAR FileOut)

Saves the contents of the given window to a file.

Parameter
WindowHandle | Windows handle of the window (e.g. obtained from CURRENT-WINDOW:HWND), you want to save.
AreaType
"ALL" oder "WINDOW" | Save the whole window incl. frame and menu, etc.
"CLIENT" | Only save the client area, without frame and menu, etc..
FileIn | Filename to save the windows contents to. If no name is given, a temporary name will be used.
FileOut | The filename actually used. If the operation was not successfull it is an empty string.

call:
RUN vpr_SaveWindowToFile (myHWND,"CLIENT","",OUTPUT tempnam).


vpr_SelectPrinter

vpr_SelectPrinter | (CHAR PrinterName).

Selects the current printer, using its Windows printername.

The Windows printer name can be found under "printer" in the system-control or in any standard printer dialogue. You can also use the printers program that is shipped with viper.

If Viper cannot find the requested printer, it will leave the selection unchanged and set the RETURN VALUE

Note: The printer naming conventions of Windows 3.1x / 95 and Windows NT are different. Therefore the names for network printers cannot be the same on Windows NT and 3.1x / 95. As long as you stay with one OS you might be able to use the same printer names network wide.

call:
RUN vpr_SelectPrinter ("My_favourite_one").


vpr_SetCellAlign

vpr_SetCellAlign (CHAR CellName, CHAR GrpName, CHAR mode)

Defines the alignment of the text inside a cell.

mode | meaning
"" | default = left aligned
"left" | aligned left
"right" | aligned right
"center" | centered

call:
RUN vpr_SetCellAlign ("Pos","Hdr","center").


vpr_SetCellAutoResize

vpr_SetCellAutoResize (CHAR CellName, CHAR GrpName, CHAR mode)

Defines wether a cells height is automatically changed in accordance to the text (mode="resize" or "1" or "TRUE") or has a fixed height (other values for mode). By default, the height is correlated to the text.

Attention: The cells height is always adjusted to the needs of the text, if it is set to 0!

Tip: This feature us very helpful, if you use the cell-split feature: Set AutoResize to "NoResize" and the cells height to 0. Once the cell doesn't fit on the page (vpr_getCellHeight), set it's height with vpr_SetCellHeigth to fill the remainder of the page and be split afterwards. Then, after the vpr_NewPage you only need to reset the cells height to 0, do the obvious vpr_FlushGroup and you are done. No fiddling with the cell position, nothing.

Mode | Meaning
"Resize", "1", "True", or "yes" | Resize the cells height, to let the whole text fit in it.
"NoResize" and any other value including "" | Use the height given by vpr_SetCellPos. (Unless the given height is 0)

call:
RUN vpr_SetCellAutoResize ("Pos","Hdr","resize").


vpr_SetCellBuffer

vpr_SetCellBuffer (CHAR CellName, CHAR GrpName, CHAR Text)

Sets the additional text buffer of the cell to Text.
The additional buffer is only affected by CellBuffer-commands and not by vpr_FlushGroup or other commands. It maintains until deleted with vpr_DeleteCellBuffer. This enables for example the saving of interim values or things alike which can be used later. It is also used for processing long text, because text of any length can be added to the CellBuffer.

call:
RUN vpr_SetCellBuffer ("Pos","Hdr","Just some gibberish").


vpr_SetCellCodePage

vpr_SetCellCodePage (CHAR CellName, CHAR GrpName, CHAR CodePage)

Sets the codepage for this cell.

Codepage known to Viper:

CodePage Name | Windows internal name (see Windows SDK documentation)
ANSI | CP_ACP
MAC | CP_MACCP
OEM | CP_OEMCP
SYMBOL | CP_SYMBOL
THREAD | CP_THREAD_ACP
UTF7 | CP_UTF7
UTF8 | CP_UTF8

Viper also supports selecting the code page by the number of the code page (see Windows and probably the Progress documentation).

Call:
RUN vpr_SetCellCodepage ("Pos","Hdr","UTF8").


vpr_SetCellColor

vpr_SetCellColor (CHAR Cell, CHAR Group CHAR TextColor, CHAR BackgColor)

Sets the text- and background colors (color coding) of Cell in the group Group. TextColor gives the color of the text and BackgColor the background color. Using an empty string ("") or a ? for background color results in transparent background. The default coloring is black text and transparent background.
Note: Background colors are only used if the printer driver prints in graphic mode (Something like "Print TrueType as graphic" has to be selected in most drivers properties dialog). Overall the emulation of colors on a black and white printer depends strongly on the printer driver and the current settings. We recommend to use color settings only on color printers. (But feel free to test it on b/w!)

call:
RUN vpr_SetCellColor ("Pos","Hdr","Red",?).


vpr_SetCellFont

vpr_SetCellFont (CHAR CellName CHAR GrpName, INT height, INT width, CHAR format, CHAR FontName)

Defines the font attributes of the cell CellName in GrpName. The size of the font with the name FontName is variable. The width-parameter can be used for stretching or compacting the font width. when the width is set, the proportional fonts also have a fixed font width.Under normal circumstances, width=0 is standard. This configuration creates normal width fonts, that are correspondingly proportional.

The format parameter must be supplied as a commaseperated string containing the keywords "italic", "underline", "strikeout", or "bold" in any combination or it has to be an empty string ("") if none of these format attributes should be applied.

Call:
RUN vpr_SetCellFont IN h-viper ("Pos","Hdr",12,0,"bold,italic","Times New Roman").

Times New Roman, 12 points, bold and italic will be configured for the cell Pos in the Group Hdr.)
note:
The default font, if you do not use vpr_SetCellFont is Times New Roman, normal, 12 point.


vpr_SetCellHeight

vpr_SetCellHeight (CHAR CellName, CHAR GrpName, INT height)

Sets height of the cell to "height"

Call:
RUN vpr_SetCellHeight ("Pos","Hdr",350).


vpr_SetCellLongText

vpr_SetCellLongText (CHAR CellName, CHAR GrpName, LONGCHAR text)

Fills the cell 'CellName' in Group 'GrpName' with the string in 'text'. This is the LONGCHAR equivalent to 'vpr_SetCellText'.

Call:
RUN vpr_SetCellLongText ("Pos","Hdr","POSITION probably with a pretty long text...").


vpr_SetCellPos

vpr_SetCellPos (CHAR CellName, CHAR GrpName, INT x, INT y, INT width, INT height)

Defines the position of the upper left corner (x,y) of cell CellName in the Group GrpName and its width and height.

call:
RUN vpr_SetCellPos ("Pos","Hdr",40,20,100,20).

note: Cells are created downwards on the paper , corresponding to the print lines. By default, the height of the cell will correlate to the actual neccessary height. This can be changed with the command vpr_SetCellAutoResize .


vpr_SetCellRotation

vpr_SetCellRotation (CHAR cell, CHAR group, DEC angle)

Allows to rotate the text displayed by cell. NOTE: The rotation will not be reflected in the calculation of cell height and width, so it is best to exclusively use rotated cells in groups with the FIXED attribute set to TRUE.

call:
RUN vpr_SetCellRotation ("mycell", "myGroup", 15.5).


vpr_SetCellRTF

vpr_SetCellRTF (CHAR CellName, CHAR GrpName, CHAR Mode)

Turns on/off the RTF mode for the given cell. This enables the cell to print RTF formatted texts. Currently Viper is able to print bold, underlined, italic und stroke text.

Besides changes of font and fontsize are supported in Viper since version 2.43. It must be pointed out that at the moment no font information out of paragraph styles is used. In some RTF documents ( for example from Star Office ) the font settings may not be considered. After our tests, text from WordPad or other editors which use the Windows RTF widget will be utilized correctly. But nevertheless a reasonable default font for the cells should always be set (using vpr_SetCellFont). The standard default font for the cells is "Times New Roman" with 12pts height.

The font parsing can be deactivated in the Viper(32).ini file, which can be found in the Windows directory, by setting the rtf_level key in the [RTF Level] section to 0. A Viper RTF with a preset for the rtf_level will be generated at the first run of the new Viper version.

Every other RTF tag should be ignored but the text should be printed. (You may know this behaviour from WordPad and tables).

Mode | Action
"ON" or "rtf" | Turns RTF features on for this cell.
"OFF" or "nortf" | Turns RTF features off.

call:
RUN vpr_SetCellRTF ("Pos","Hdr","RTF").

see also: vpr_Asc2RTF, vpr_ToRTF and rtf.i


vpr_SetCellSplit

vpr_SetCellSplit (CHAR CellName, CHAR GrpName, CHAR Mode)

Sets the split mode for the cell given with CellName and GrpName. This command can be used in conjunction with vpr_GetCellLineCount to print the cells contents distributed over several pages.

Mode |
SPLIT, ON | Enables splitting. After a vpr_FlushGroup the printed lines a removed, the rest remains.
COPY | Enables special, somewhat odd split mode: The whole text remains in the cell, even the already printed lines.
NOSPLIT, OFF | Disables splitting.

call:
RUN vpr_SetCellSplit ("Pos","Hdr","SPLIT").


vpr_SetCellText

vpr_SetCellText (CHAR CellName, CHAR GrpName, CHAR text)

Fills the cell CellName in Group GrpName with the string in text.

Call:
RUN vpr_SetCellText ("Pos","Hdr","POSITION").


vpr_SetCellWrap

vpr_SetCellWrap (CHAR CellName, CHAR GrpName, CHAR mode)

Switches the autowrapping feature of a cell on or off. By default the autowrapping is disabled.

mode | Meaning
"WRAP", or "TRUE", or "ON" | enable autowrapping mode
anything else | disable autowrapping (default)

call:
RUN vpr_SetCellWrap ("Pos","Hdr","wrap").


vpr_SetCurrentPageProperties

vpr_SetCurrentPageProperties (CHAR property, CHAR value)

Sets properties of the current page.

Property | Values | Effect
"Papertray" | Number of the tray (e.g. "5") | Select the paperbin for the current and following pages
"Paperorientation" | "Landscape" or "Portrait" | Select the paper orientation for the current and the following pages. This, of course, also changes the size of the current page. If your report depends on viper to determine the free space or the page size, it is advisable to call this directly after a NewPage.
"Paperheight" | "Pageheight in 1/10 mm." | Set the height of the current page. Attention: The pageheight is going to be changed, this command should preferably be called directly after a vpr_NewPage command.
"Paperwidth" | "Pagewidth in 1/10 mm." | Set the width of the current page.

Call:
RUN vpr_SetCurrentPageProperties ("papertray", "1")


vpr_SetDelimiter

vpr_SetDelimiter | (char del)

Sets the delimiter, that is used internally by viper and in the vpr_SetGroupText command. The default value is ascii 1.
Important! The delimiter must never appear in a parameter or text that is given to viper, unless it is the textlist of SetGroupText. Otherwise the result can not be predicted. Use this feature with extreme care. If you are not sure about, only change it temporarily.

call:
RUN vpr_SetDelimiter (",").
Sets the comma as delimiter.


vpr_SetDocAttrib

vpr_SetDocAttrib | (CHAR attribs).

vpr_SetDocAttrib sets some document attributes. Currently two attributes are available: CREATEMODE and PAPERSIZE.
Attrib is a comma separated key=value list of the attributes you want to set.

Attribute Meaning
CREATEMODE=AUTO | MANUAL | VFD Sets the mode for the creation of cells.
Mode | Meaning
AUTO | This is the default behaviour: most Viper commands that write to a cell (most notably vpr_SetCellPos and vpr_SetCellText) will create the cell automatically.
MANUAL | Cells are only created if you issue a vpr_DefCell. All other Viper commands are ignored if a non existing Cell is given.
VFD | vpr_DefCell as well as vpr_SetCellPos create Cells. All other Viper commands are ignored if a non existing Cell is given. This allows you to create a generic report program that sets the text for cells for all kinds of data and to only print the cells defined in the Viper Designer.
PAPERSIZE=(a_known_papersize) Sets the papersize for the document. This also tells the printer which papersize to use (and the printer should choose a fitting tray, then).

Papersizes known to Viper:
"LETTER", "LEGAL", "10X14", "11X17", "12X11", "A3", "A3_ROTATED", "A4", "A4_ROTATED", "A4SMALL", "A5", "A5_ROTATED", "A6", "A6_ROTATED", "B4", "B4_JIS_ROTATED", "B5", "B5_JIS_ROTATED", "B6_JIS", "B6_JIS_ROTATED", "CSHEET", "DBL_JAPANESE_POSTCARD", "DBL_JAPANESE_POSTCARD_ROTATED", "DSHEET", "ENV_9", "ENV_10", "ENV_11", "ENV_12", "ENV_14", "ENV_C5", "ENV_C3", "ENV_C4", "ENV_C6", "ENV_C65", "ENV_B4", "ENV_B5", "ENV_B6", "ENV_DL", "ENV_ITALY", "ENV_MONARCH", "ENV_PERSONAL", "ESHEET", "EXECUTIVE", "FANFOLD_US", "FANFOLD_STD_GERMAN", "FANFOLD_LGL_GERMAN", "FOLIO", "JAPANESE_POSTCARD_ROTATED", "JENV_CHOU3", "JENV_CHOU3_ROTATED", "JENV_CHOU4", "JENV_CHOU4_ROTATED", "JENV_KAKU2", "JENV_KAKU2_ROTATED", "JENV_KAKU3", "JENV_KAKU3_ROTATED", "JENV_YOU4", "JENV_YOU4_ROTATED", "LAST", "LEDGER", "LETTER_ROTATED", "LETTERSMALL", "NOTE", "P16K", "P16K_ROTATED", "P32K", "P32K_ROTATED", "P32KBIG", "P32KBIG_ROTATED", "PENV_1", "PENV_1_ROTATED", "PENV_2", "PENV_2_ROTATED", "PENV_3", "PENV_3_ROTATED", "PENV_4", "PENV_4_ROTATED", "PENV_5", "PENV_5_ROTATED", "PENV_6", "PENV_6_ROTATED", "PENV_7", "PENV_7_ROTATED", "PENV_8", "PENV_8_ROTATED", "PENV_9", "PENV_9_ROTATED", "PENV_10", "PENV_10_ROTATED", "QUARTO", "STATEMENT", "TABLOID"

NOTE: Viper can only set papersizes that are supported by the currently selected printer. If the printer doesn't support the selected papersize, the default one will be used.
DEFAULTGROUPCELLPOSITIONING Sets the default "GroupCellPositioning" (see here), i.e. the way the cells are positioned after a vpr_FlushGroup. This is mostly useful for migrating reports that where designed for Viper 2.x, because it used a default value of "0" while all newer versions use "1"

Posible values:

  • 0=position all cells on one horizontal line (the default mode for Viper prior to 3)
  • 1=the relative positions of the cells in the group are retained. (the default mode since Viper 3

Example for "CREATEMODE=VFD"
Let's assume you have created the following report file:

{vpr.i INIT}
{vpr.i START}

RUN vpr_LoadVFR ("N:\t4p\Viper\test\jc\createmode.vfr").
RUN vpr_ActivateReport ("report").

RUN vpr_SetDocAttrib("createmode=vfd").

RUN vpr_InitGroups("").
RUN vpr_InitGraphObj.
RUN vpr_FlushGroup("Header").

FOR EACH ITEM:
    /*
     * set the cell texts
     */
    RUN vpr_SetCellText("Item-num", "body" ,STRING(item.Item-num)).
    RUN vpr_SetCellText("Item-name", "body" ,item.Item-name).
    RUN vpr_SetCellText("Cat-Description", "body" ,Cat-Description).
    RUN vpr_SetCellText("Cat-Page", "body" ,STRING(Cat-Page)).
    RUN vpr_SetCellText("On-Hand", "body" ,STRING(On-hand)).
    RUN vpr_SetCellText("Price", "body" ,STRING(Price, ">>>>9.99")).

    /*
     * check if our group still fits on the page
     * to do this, we test it against the position of the footer's stopper cell defined in the vfr.
     */
    IF vpr_GetPageVSPace() < 200 THEN
    DO:
        RUN vpr_newPage.
        RUN vpr_InitGroups("").
        RUN vpr_InitGraphObj.
        RUN vpr_FlushGroup("Header").
    END.
    RUN vpr_FlushGroup("body").
END.

RUN vpr_EndDoc.
RUN vpr_ShowPreview.

PAUSE.
{vpr.i STOP}

If your createmode.vfr now only defines the cells "Item-num", "Item-name", and "Price" for the group "body", only these will be printed in your report. "Cat-Description", "cat-Page", and "On-hand" will be silently ignored. For a more sophisticated example have look at the "myVfd"-demo.

call:

RUN vpr_SetDocAttrib ("CreateMode=vfd").


vpr_SetDocTitle

vpr_SetDocTitle (CHAR name)

Sets the documents name. In the windows printer queue the document will be shown by this name. The sysadmin will be happy :-)

parameter:
name document name

call:
RUN vpr_SetDocTitle ("myDoc.com").


vpr_SetGraphObj

vpr_SetGraphObj (CHAR objname, CHAR grpname, CHAR type, int x, int y, int width, int height, CHAR attribs)

Create a graphical object of type type that belongs to group grpname.
The object's position is x, y with width and height setting the width and height of the object or (in case of a LINE) its end point.
Object and type specific attributes can be set with the key-value list attribs, using a comma (,) as list separator and an equal sign (=) separating key and value (e.g.: "FILENAME=MyImage.jpg, RESIZE=true, NoKeepRatio").Where indicated, it is possible to omit the value, setting the attribute to a (hopefully) sensible and obvious default.

Table: GraphObj types and allowed attributes (Types and attributes are case-insensitive)
Type | Meaning | Attributes | Remarks
RECT | RECTANGLE | a rectangle | COLOR=R:G:B, FILLED|FILL=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | Default ZORDER is 500
RNDRECT | ROUNDRECT | RNDRECTANGLE | ROUNDRECTANGLE | a rectangle with rounded corners | COLOR=R:G:B, FILLED|FILL=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | Default ZORDER is 500
LINE | a line | COLOR=R:G:B, STYLE=SOLID|DASH|DOT|DASHDOT|DASHDOTDOT, HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn, LINEWIDTH=nnnn | starting point x,y and end point width,height Default ZORDER is 500
BMP | JPG | BITMAP | JPEG | IMAGE | an image in BMP, JPEG, or WMF/EMF format | [FILE]NAME=name_of_the_image_file, [NO]RESIZE=[TRUE|YES|FALSE|NO], [NO]KEEPRATIO=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | If no [FILE]NAME is given, Viper tries to use the objname as filename. If the image file is not available, nothing will be printed. Default ZORDER is 1

Table: Known attributes (Square brackets indicate optional parts)
Attribute | Explanation
ZORDER The z-order of this object. This is the order in which the objects are drawn and therefore stacked over each other, if they overlap: Objects with a higher z-order are printed above objects with a lower one.
The default values are:
RECTANGLE | 500
ROUNDRECT | 500
LINE | 500
IMAGE | 1
CELLs have a ZORDER of 1000 and therefore are printed on top of GraphObjs with their default ZORDER. Graphical objects that are not part of a group (DefRect, DefBMP, etc) have a ZORDER of 0.
The ZORDER is a 32 bit integer, its maximal value is 2147483647, its minimum is -2147483648.
HIDE|HIDDEN | Hides/unhides this graphic object. The object will still be in the group and its size and position is maintained and still used by the group, it is just not drawn.
COLOR | Defines a color. The value is given as an R:G:B tupel, separating the color channels with a colon (:). Note: Unlike the color definitions of previous Viper versions (for Cells and DefXXX graphic objects), a comma (,) cannot be used to separate the color values and named colors are not supported.
FILLED
FILL 		A logical attribute telling Viper if the object should be filled or if only its outline should be drawn. Vipers default value is false
If the value (right hand side) is omitted, "TRUE" is used.
STYLE The style in which a line is printed:
SOLID | Prints a solid (continuous) line
DASH | Prints a line broken into dashes (------)
DOT | Prints a dotted line (........)
DASHDOT | Mixes dashes with dots (-.-.-.-)
DASHDOTDOT | A dash and two dots (-..-..-..)

Only works for lines with a width of 1.
LINEWIDTH | The width of the line. Default is 1.
[FILE]NAME | The image file to use
[NO]RESIZE | Defines if an image should be resized to fit the given size. It should be obvious that NORESIZE is the inverse of RESIZE (i.e. RESIZE=FALSE is the same as NORESIZE or NORESIZE=YES). If an image is not resized and does not fit into the given rectangle it is clipped.
[NO]KEEPRATIO | If an image is resized, this defines if the width/height-ratio of the original image should be retained. NOKEEPRATIO is the inversion of KEEPRATIO (i.e.: KEEPRATIO is the as NOKEEPRATIO=FALSE, etc).

call:

RUN vpr_SetGraphObject ("MyGObj", "Group1", "Rect", 10,10,300,30, "filled=yes").


vpr_SetGraphObjAttrib

vpr_SetGraphObjAttrib (CHAR objname, CHAR grpname, CHAR attribs)

Set the attributes of the graphical object objname in the group grpname to the attributes given in the key-value list attribs.
The key-value list attribs, is a comma (,) separated list, using an equal sign (=) to separate key and value (e.g.: "FILENAME=MyImage.jpg, RESIZE=true, NoKeepRatio").Where indicated, it is possible to omit the value, setting the attribute to a (hopefully) sensible and obvious default.

Table: GraphObj types and allowed attributes (Types and attributes are case-insensitive)
Type | Meaning | Attributes | Remarks
RECT | RECTANGLE | a rectangle | COLOR=R:G:B, FILLED|FILL=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | Default ZORDER is 500
RNDRECT | ROUNDRECT | RNDRECTANGLE | ROUNDRECTANGLE | a rectangle with rounded corners | COLOR=R:G:B, FILLED|FILL=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | Default ZORDER is 500
LINE | a line | COLOR=R:G:B, STYLE=SOLID|DASH|DOT|DASHDOT|DASHDOTDOT, HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | starting point x,y and end point width,height Default ZORDER is 500
BMP | JPG | BITMAP | JPEG | IMAGE | an image in BMP, JPEG, or WMF/EMF format | [FILE]NAME=name_of_the_image_file, [NO]RESIZE=[TRUE|YES|FALSE|NO], [NO]KEEPRATIO=[TRUE|YES|FALSE|NO], HIDE|HIDDEN=[TRUE|YES|FALSE|NO], ZORDER=nnnnn | If no [FILE]NAME is given, Viper tries to use the objname as filename. If the image file is not available, nothing will be printed. Default ZORDER is 1

Table: Known attributes (Square brackets indicate optional parts)
Attribute | Explanation
ZORDER The z-order of this object. This is the order in which the objects are drawn and therefore stacked over each other, if they overlap: Objects with a higher z-order are printed above objects with a lower one.
The default values are:
RECTANGLE | 500
ROUNDRECT | 500
LINE | 500
IMAGE | 1
CELLs have a ZORDER of 1000 and therefore are printed on top of GraphObjs with their default ZORDER. Graphical objects that are not part of a group (DefRect, DefBMP, etc) have a ZORDER of 0.
The ZORDER is a 32 bit integer, its maximal value is 2147483647, its minimum is -2147483648.
HIDE|HIDDEN | Hides/unhides this graphic object. The object will still be in the group and its size and position is maintained and still used by the group, it is just not drawn.
COLOR | Defines a color. The value is given as an R:G:B tupel, separating the color channels with a colon (:). Note: Unlike the color definitions of previous Viper versions (for Cells and DefXXX graphic objects), a comma (,) cannot be used to separate the color values and named colors are not supported.
FILLED
FILL 		A logical attribute telling Viper if the object should be filled or if only its outline should be drawn. Vipers default value is false
If the value (right hand side) is omitted, "TRUE" is used.
STYLE The style in which a line is printed:
SOLID | Prints a solid (continuous) line
DASH | Prints a line broken into dashes (------)
DOT | Prints a dotted line (........)
DASHDOT | Mixes dashes with dots (-.-.-.-)
DASHDOTDOT | A dash and two dots (-..-..-..)

Only works for lines with a width of 1.
LINEWIDTH | The width of the line. Default is 1.
[FILE]NAME | The image file to use
[NO]RESIZE | Defines if an image should be resized to fit the given size. It should be obvious that NORESIZE is the inverse of RESIZE (i.e. RESIZE=FALSE is the same as NORESIZE or NORESIZE=YES). If an image is not resized and does not fit into the given rectangle it is clipped.
[NO]KEEPRATIO | If an image is resized, this defines if the width/height-ratio of the original image should be retained. NOKEEPRATIO is the inversion of KEEPRATIO (i.e.: KEEPRATIO is the as NOKEEPRATIO=FALSE, etc).

call:

/* this assumes we have a RECT or ROUNDRECT */
RUN vpr_SetGraphObjectAttrib ("MyGObj", "Group1", "filled=yes, color=240:240:240").


vpr_SetGroupAttrib

vpr_SetGroupAttrib | (CHAR attribs).

vpr_SetGroupAttrib sets some group attributes. Currently the only available attribute is: FIXED.
Attrib is a comma separated key=value list of the attributes you want to set.

Attribute | Meaning
FIXED=[TRUE|YES|FALSE|NO] | Sets this groups position to be fixed. After a FlushGroup the group will retain its position. It also won't be included in the calculation of the current page position (also see vpr_GetPageVPos, vpr_GetPageVPos, vpr_GetPageVSpace, and vpr_GetPageVSpace). This allows you to add items like footers to a page before you create the varying part. Makes your life easier.

Example for "FIXED=TRUE"
The following example assumes that you have created a report template (using Viper Designer) that defines a "header" and a "footer" group.:

{vpr.i INIT}
{vpr.i START}

PROCEDURE initPage:
    RUN vpr_InitGroups("").
    RUN vpr_InitGraphObj.
    /*
     * set header and footer to be "fixed" groups
     * this allows us to FlushGroup them as the very
     * first thing on a page. It will not interfere with the page's
     * current position pointer
     */
    RUN vpr_SetGroupAttrib ("Header", "Fixed=true").
    RUN vpr_FlushGroup ("Header").
    RUN vpr_SetGroupAttrib ("Footer", "Fixed=true").
    RUN vpr_FlushGroup ("Footer").
END.

/*
 * initialize the report
 */
RUN vpr_LoadVFR ("example/mass3.2/massdemo3.2.vfr").
RUN vpr_ActivateReport ("massdemo3.2").
RUN initPage.

FOR EACH ITEM:
    RUN vpr_SetCellText("Item-num", "body" ,STRING(item.Item-num)).
    RUN vpr_SetCellText("Item-name", "body" ,item.Item-name).
    RUN vpr_SetCellText("Cat-Description", "body" ,Cat-Description).
    RUN vpr_SetCellText("Cat-Page", "body" ,STRING(Cat-Page)).
    RUN vpr_SetCellText("Price", "body" ,Price).

    IF vpr_GetGroupHeight("body") + vpr_GetPageVPos() >= vpr_getCellVPos("Stopper", "footer") THEN
    DO:
        RUN vpr_newPage.
        RUN initPage.
    END.
    RUN vpr_FlushGroup("body").
END.

RUN vpr_ShowDoc.

{vpr.i STOP}

call:

RUN vpr_SetGroupAttrib ("group", "FIXED=true").


vpr_SetGroupCellPositioning

vpr_SetGroupCellPositioning (CHAR GrpName, INT Mode)

Sets the way the cells are positioned after a vpr_FlushGroup.

  • 0=position all cells on one horizontal line (the default mode for Viper prior to 3)
  • 1=the relative positions of the cells in the group are retained. (the default mode since Viper 3

Call:

RUN vpr_SetGroupCellPositioning  ("Group1", 1).


vpr_SetGroupSkip

vpr_SetGroupSkip (CHAR GrpName, CHAR unit, INT PreSkip, INT PostSkip)

Defines the amount of free space before and after a logical line of a group. The Parameter unit controls whether the given values are interpreted as typographical points or as units of 0.1mm.

Parameter | Meaning
GrpName | Name of the group.
unit | Defines whether to interpret the PreSkip and PostSkip values as typographical points or not. To use points this parameter must be supplied as "pt" or "points", in any other case a tenth of a millimeter will be used.
PreSkip | The blank space before a logical line.
PostSkip | The space left after a logical line.

This command enables you to use automatically created blank space between logical lines. After a vpr_FlushGroup the cursor is positioned between the PostSkip of the old line and the PreSkip of the new one, thus offering an easy way to put separators between logical lines that have a proper distance to he texts of the previis and the current line. In this manner it is as well possible to draw rectangles that start and end in some distance before and after a logical line; the vpr_GetGroupHeight command uses the skip values automatically.

call:
RUN vpr_SetGroupSkip ("Hdr","pt",2,3).
(Defines a space of two typographical points before and three points after a logical line.)


vpr_SetGroupText

vpr_SetGroupText (CHAR GrpName, CHAR CellList, CHAR TextList)

Sets the texts of the group GrpName's cells given in CellList to the values given in TextList.
The cells given in CellList must be separated by commas, while the texts in TextList have to be seperated by the delimiter, that is defined via vpr_SetDelimiter.
The first cell is filled with the first text, the second one with the second text and so on.

Example:

RUN vpr_SetDelimiter  (";").

RUN vpr_SetGroupText  ("Group1", "number,position,price","1;shoes;200").

does the same as:

RUN vpr_SetCellText  ("number", "Group1", "1").

RUN vpr_SetCellText  ("position", "Group1", "shoes").

RUN vpr_SetCellText  ("price", "Group1", "200").

but is much faster.

Note: Starting with Viper 3.0, the OLE mechanism isn't used anymore. Therefore the speed gain of using vpr_SetGroupText may not be significant anymore, if there still is one. But of course vpr_SetGroupText may still be more convenient to you.


vpr_SetGroupVPos

vpr_SetGroupVPos (CHAR GrpName, INT VPos)

Sets the vertical position of the whole group GrpName to the position given with VPos.
The relative position of the cell is handled according to the rules that vpr_FlushGroup uses. Also see: vpr_SetGroupCellPositioning

call:
RUN vpr_SetGroupVPos("myGroup", 120).


vpr_SetPageOrientation

vpr_SetPageOrientation (CHAR orientation)

Sets the orientation (windows-default, portrait, or landscape) of the current document. This command should be used at the beginning of a document, otherwise the pagesize will not be handled properly by the corresponding query functions. The default paperorientation is the one taken from windows.

Orientation | Meaning
Default | Use the windows defaults
Portrait | Print in portrait mode, regardless of the selection within windows
Landscape | Print in landscape mode, don't care about windows default.

call:
RUN vpr_SetPageOrientation ("LANDSCAPE").


vpr_SetPageVPos

vpr_SetPageVPos (INT newPos)

Sets the current vertical position (as queried by vpr_GetPageVPos, or - indirectly - by vpr_GetPageVSpace) to newPos.
This can be useful for multicolumn reports. For example this report prints pages with three columns of item names:

{vpr.i INIT}
{vpr.i START}

DEFINE VARIABLE lp-column AS INTEGER    NO-UNDO.
DEFINE VARIABLE lp-ii     AS INTEGER    NO-UNDO.

RUN vpr_SetCellPos("cell", "group", 10, 10, 300, 0).

/* The sports db doesn't have enough items,
 * so we need a few loops here */
DO lp-ii = 1 TO 5:
    FOR EACH ITEM:
        RUN vpr_SetCellText("cell", "group", Item-Name).
        RUN vpr_FlushGroup("group").
        IF vpr_GetPageVSpace() < 100 THEN DO:
            IF lp-column = 2 THEN DO:
                /* third column has already been printed: create a new page */
                RUN vpr_NewPage.
                lp-column = -1.
            END.
            lp-column = lp-column + 1.
            RUN vpr_SetCellPos("cell", "group", 10 + 400 * lp-column, 10, 300, 0).
            /* reset the current vertical position on the page */
            RUN vpr_SetPageVPos(0).
        END.
    END.
END.

RUN vpr_EndDoc.
PAUSE.

{vpr.i STOP}

Call:
RUN vpr_SetPageVPos(0).


vpr_SetPaperSize

vpr_SetPaperSize (INT width, INT height)

Sets the documents papersize. The papersize can only be set within the limits of the printer driver.

parameter:
width | paperwidth in 1/10 mm
height | paperheight in 1/10 mm

call:
RUN vpr_SetPaperSize (1000,2000).


vpr_SetPreviewMode

vpr_SetPreviewMode (CHAR mode)

Sets the preview mode for VIPER. The default is "preview".

mode | Meaning
Preview | Uses the preview
Direct | Prints without preview. The whole document up to a vpr_PrintDoc command is printed at once. The Preview can be started at any given time by calling vpr_ShowPreview.
PageByPage | The pages are printed directly after any vpr_NewPage command.

note: In PageByPage mode no page counting is supported, due to the fact that it is impossible for VIPER to determine beginning and end of documents.

call:
RUN vpr_SetPreviewMode ("Direct") .


vpr_SetPrinterAttrib

vpr_SetPrinterAttrib | (CHAR attribs).

vpr_SetPrinterAttrib sets some printing attributes. By now these are: copies, from (starting page) , to (last page), FileToand ToFile, duplex.
Attrib is a comma separated list of the attributes you want to set.

Attribute | Meaning
from=n | n gives the starting page for vpr_PrintDoc(0,0).
to=n | n gives the final page for vpr_PrintDoc(0,0).
copies=n | n gives the number of copies to print.
FileTo=filename | Sets the filename for printing to file to filename.
ToFile=Yes/No | Yes activates printing to file, without user interaction. No deactivates it.
duplex=0/1/2/3

Controls duplex printing, if the printer supports it

0 | use printer default
1 | simplex
2 | duplex (horizontal)
3 | duplex (vertical)

call:
RUN vpr_SetPrinterAttrib ("copies=3,to=4,from=1,tofile=yes,FileTo=myprintfile.prn").
(sets three copies and a printing range from page 1 to page 4, print to file myprintfile.prn)


SetPrinterDialogMode

SetPrinterDialogMode | (CHAR mode).

Selects if the printer dialog should be called prior to printing.

mode | Bedeutung
ON | Switches the dialog on.
OFF (default) | 'print'-button prints without calling the printer dialog.

call:
RUN SetPrinterDialogMode IN h-viper ("ON").


vpr_SetTempDir

vpr_SetTempDir (CHAR tempDirectory)

Sets the directory that Viper uses for temporary files, e.g. the files for the vpr_ShowDoc preview
Please note that Viper does not do any checks on this. Make sure that the value given for tempDirectory is an existing and writable directory, otherwise Viper will not be able to create temporary files, might not work at all or even write unwanted files to arbitrary places.

Call:
RUN vpr_SetTempDir ("c:\tmp").


vpr_SetWindowPos

vpr_SetWindowPos (INT left, INT top, INT width INT height

Sets the position of the preview window. You can set these values prior to displaying the window.

call:
RUN vpr_SetWindowPos (20,20,200,400).


vpr_ShowDoc

Shows the preview window with all pages persistently.
Preview is detached from current session and cannot be hidden using vpr_HidePreview.

call:
RUN vpr_ShowDoc.

See also: vpr_ShowPreview.


vpr_ShowPreview

Shows the preview window with all pages processed up to the vpr_ShowPreview call. You can hide the window again using vpr_HidePreview.

Call:
RUN vpr_ShowPreview .

Note: vpr_ShowPreview works regardless of the selected preview mode.

See also: vpr_ShowDoc.


vpr_SubmitCellBuffer

vpr_SubmitCellBuffer (CHAR CellName, CHAR GrpName)

Copies the contents of the additional cell buffer into the cells text. The contents of the buffer is not deleted!
The additional buffer is only affected by CellBuffer-commands and not by vpr_FlushGroup or other commands. It maintains until deleted with vpr_DeleteCellBuffer. This enables for example the saving of interim values or things alike which can be used later. It is also used for processing long text, because text of any length can be added to the CellBuffer.

call:
RUN vpr_SubmitCellBuffer ("Pos","Hdr").


vpr_ToRTF

CHAR RTFString = vpr_ToRTF (CHAR InString, CHAR Attribs)

Adds the given attributes to InString and escapes some RTF control sequences. Attribs is a comma separated list with wrapper attributes. RTFString gives the transformed string.
Attributes: bold, italic, underline, strike

Example:
     DEF VAR StrikeText AS CHAR NO-UNDO INIT "".
     RUN vpr_SetCellText  ("c1","g1","This is " + vpr_ToRTF  ("wrong","strike")+ ".").

see also:vpr_Asc2RTF and rtf.i


vpr_WebPrintDoc

vpr_WebPrintDoc (INT from, INT to CHAR method)

For using Viper with Webspeed 3.x you currentIy need a special version of the Viper32.dll. Please look at http://viperdemo.tools4progress.com/ for additional information or contact info@tools4progress.com .

This command prints a document to a PDF file and then outputs it to the Webstream. Depending on the parameter method it tries to send the document as "text/pdf ", prints it's URL or creates a webpage that loads the document (using javascript). From and to specify the first and last pages to be printed. With from=0, to=0 all pages are printed.

method |
"direct" | tries to send the page as content-type "text/pdf". There seems to be a bug in WS 2.1 cgiip.exe (and probably in wsapi.dll too) that replaces every LF character with the CR/LF sequence, regardless of the content-type and settings. As PDF files depend on the correct characters this option doesn't work for WS 2.x.
"href" | This options prints the URL of the document to the Webstream.
"reload" (or, so far, actually any value except "direct" and "href") | Uses Javascript to load the PDF file. (<body onload="document.location.href=...">). Currently this is the default method.

Please see the section Viper Setup for some details on how to setup Viper for PDF printing!

call:

RUN vpr_WebPrintDoc  (0,0, "").
(This uses the default method, by now: reload)


CONTROL- AND SETUP-COMMANDS

Preview Control
Commands and functions that control the preview window
vpr_GetPreviewStatus vpr_FetchPreviewStatus | Waits for a given time (milliseconds) and returns the current status of the preview windows (shown or hidden/closed)
vpr_HidePreview | Closes (hides) the preview window
vpr_SetPreviewMode | Sets the previewmode for VIPER.
vpr_SetTempDir | Sets the temporary directory used by Viper
vpr_SetWindowPos | Sets the position and size of the preview window
vpr_ShowDoc | Shows preview persistently.
vpr_ShowPreview | Activates (shows) the preview window
Printer Control
Commands and functions that set and query printer related attributes and behaviour.
vpr_GetPrinterAttrib vpr_FetchPrinterAttrib | Obtain some printer attributes, by now only paperheight und -width.
vpr_PrinterDialog | Calls the standard windows printer dialog
vpr_PrintOptions | Set some printing options. By now only enables/disables the print status window
vpr_PrinterSetup | Calls the printer setup dialogue
vpr_SelectPrinter | Selects the printer using the windows printer name
vpr_SetPrinterAttrib | Sets several attributes of the printout (copies, from and to pages, prin to file and filename)
vpr_SetPrinterDialogMode | Selects whether the print-button calls the print dialog prior to printing.
Logic Control
Commands and functions that control
vpr_ActivateReport | Activate a Designer report after loading.
vpr_EndDoc | Signals the end of the document to the preview (enables print-all button and preview of the last page)
vpr_NewPage | Starts a new page


DOCUMENT-COMMANDS

Designer Support Commands
These commands are used to load, activate, and unload the report templates created by the Viper Designer
vpr_ActivateReport | Activates a Designer report after loading. Allows to select one report out of a bunch of loaded reports.
vpr_InitDoc | Initializes some document properties for the active report.
vpr_LoadDB | Loads a report from a database.
vpr_LoadVFL | Loads the old *.vfl format report libraries (as created by the pre 3.x Viper Frame Designer) from a file
vpr_LoadVFR | Loads a report from a file.
vpr_RemoveReport | Removes a loaded report from memory.
Printing and Exporting
vpr_ExportDoc | Exports current report in defined format (xslfo).
vpr_PrintDoc | Commences printing
vpr_PrintPDF | Save/print a Viper document as PDF file.
vpr_WebPrintDoc | Some support to print a viper document as a webpage. (only for integration with Webspeed)
Saving, Loading, and Deleting
Well, saving, loading and erasing of documents
vpr_OpenDoc | Loads a saved document
vpr_ResetDoc | Deletes the current document
vpr_SaveDoc | Saves a viper document
General Document Control
vpr_GetPageNo vpr_FetchPageNo | Gives the number of pages in document
vpr_SetPageOrientation | Sets the print-orientation of a document
vpr_EndDoc | Signals the end of the document to the preview (enables print-all button and preview of the last page)
vpr_NewPage | Starts a new page
vpr_SetDocAttrib | Sets some document specific attributes.
vpr_SetDocTitle | sets the document title shown in the windows printer queue
vpr_SetPaperSize | Sets the documents paper size.
vpr_ShowDoc | Shows preview persistently.
vpr_ShowPreview | Activates (shows) the preview window
vpr_HidePreview | Closes (hides) the preview window
vpr_SetPreviewMode | Sets the previewmode for VIPER.


PAGE COMMANDS

PAGE CONTROL COMMANDS

Generic Page Properties
Commands and functions that work on some basic properties of the page
vpr_FetchPageNo | Gives the number of pages in document
vpr_GetPageNo | Gives the number of pages in document
vpr_NewPage | Starts a new page
vpr_SetCurrentPageProperties | Set certain properties on a per page basis, e.g. the paper bin.
vpr_SetPageOrientation | Sets the print-orientation of a document.
"Cursor" Control
Commands and functions that maintain and query the current position and space on the page
vpr_FetchPageVPos | Obtains current cursor position
vpr_FetchPageVSpace | Gives an account of free space on page
vpr_GetPageVPos | Obtains current cursor position
vpr_GetPageVSpace | Gives an account of free space on page
vpr_SetPageVPos | Sets the current vertical position
Designer Support Commands
These commands are used to initialize (and re-initialize on each page) the objects defined in the Viper Designer
vpr_InitGraphObj | Initializes Designer Graphic objects.
vpr_InitGroups | Initializes Designer Groups
vpr_InitImg |
vpr_InitLin |
vpr_InitRect |


GROUP COMMANDS

Group Control
Some general commands
vpr_DelGroups | Deletes Groups
vpr_FlushGroup | Prepares a group for printing
vpr_InitGroups | Initializes Designer Groups
Setting Group Attribute
Commands that change the group's properties
vpr_SetGroupAttrib | Sets some group attributes.
vpr_SetGroupCellPositioning | Enables the group to retain the cells relative positions in the group after a vpr_FlushGroup.
vpr_SetGroupSkip | Defines the free space before and after a logical line of a group
vpr_SetGroupText | Sets the text for several cells of a group
vpr_SetGroupVPos | Sets the vertical position of a whole group
Retrieving Information (Functions)
Functions to retrieve some of the group's properties. For PROCEDURE counterparts see below.
vpr_GetGroupHeight | Gives the group height
vpr_GetGroupVPos | Retrieves the vertical position of a group
Retrieving Information (Procedures)
Procedures to retrieve some of the group's properties. For FUNCTION counterparts see above.
vpr_FetchGroupHeight | Gives the group height
vpr_FetchGroupVPos | Retrieves the vertical position of a group


CELL COMMANDS

Cell Creation And Deletion
These commands allow to create and delete cells.
vpr_DefCell | Creates a cell
vpr_DelCell | Deletes a cell
Cell Buffer Operations
The cell buffer is a string buffer, that in itself is completely separated from the text value of a cell and is retained between different "flushes". It was introduced to allow to transmit texts larger than 32k into a cell (most notably texts coming from external sources like editor controls or files). With OE 10 it should be possible to solve this problem using the LONGCHAR datatype. It can be used for any purpose, though. For example one can collect text over a couple of "flushes" in the buffer and finally submit it to the "cell text".
vpr_AddToCellBuffer | Add text to a cells additional text buffer
vpr_DeleteCellBuffer | Clears the additional text buffer
vpr_SubmitCellBuffer | Copy the contents of the cells additional buffer into the cell text
Setting Cell Attributes
Commands that allow to set the attributes of a cell. Except for the text and the position these attributes are retained between different instances (via vpr_FlushGroup) of the cell.
vpr_SetCellAlign | Aligns the text in a cell
vpr_SetCellAutoResize | Corresponds cell height to text length
vpr_SetCellBuffer | Set the additional textbuffer of a cell.
vpr_SetCellCodePage | Sets the codepage for the given cell
vpr_SetCellColor | Sets the fore- and backgroundcolor of a cell
vpr_SetCellFont | Sets font for a cell
vpr_SetCellHeight | Sets a cells height
vpr_SetCellLongText | Sets the text to be printed by a cell (LONGCHAR version)
vpr_SetCellPos | Defines the position and size of a cell
vpr_SetCellRTF | Turn RTF mode on or off for the given cell.
vpr_SetCellSplit | Enable a cell to print its contents distributed over several instances (i.e. several vpr_FlushGroup commands), thus enabling you to print long text distributed over several pages.
vpr_SetCellText | Sets the text to be printed by a cell
vpr_SetCellWrap | Sets autowrapping-mode for a cell
Retrieving Information (Functions)
These functions retrieve informations about some of the cell's attributes. They all have procedural counterparts starting with "vpr_Fetch" instead of "vpr_Get", see below. The functions are only available if you activate Viper's function interface (vpf.i)
vpr_GetCellHeight | Obtains the cell height
vpr_GetCellHPos | Retrieves the horizontal position of a cell
vpr_GetCellLineCount | Retrieves number of remaining lines in the cell
vpr_GetCellTextHeigth | Returns the height of the cell's text
vpr_GetCellTextWidth | Returns the width of the cell's text
vpr_GetCellVPos | Obtains the vertical position of a cell
vpr_GetCellWidth | Obtains the cell width
Retrieving Informations (Procedures)
These procedures return informations about some of the cell's attributes in an OUTPUT parameter. They all have function counterparts starting with "vpr_Get" instead of "vpr_Fetch", see above.
vpr_FetchCellHeight | Obtains the cell height
vpr_FetchCellHPos | Retrieves the horizontal position of a cell
vpr_FetchCellLineCount | Retrieves number of remaining lines in the cell
vpr_FetchCellVPos | Obtains the vertical position of a cell
vpr_FetchCellWidth | Obtains the cell width
vpr_FetchCellTextHeight | Obtains the height of the cell's text
vpr_FetchCellTextWidth | Obtains the width of the cell's text


GRAPHIC-COMMANDS

Grouped Graphical Objects
These commands create and work with graphical objects that - just like cells - belong to Viper's groups. These objects are included in the "logical-line" formed by the group, thus when vpr_FlushGroup is called, their position is updated like that of a cell. Because they are part of a group, they are not affected by the "vpr_InitGraphObj", "vpr_InitImg", "vpr_InitLin", and "vpr_InitRect" designer-support commands.
vpr_SetGraphObj | Create a graphical object of a given type that belongs to a given group.
vpr_SetGraphObjAttrib | Sets the attributes of the specified graphical object
Independent Graphical Items
These commands create objects in the report that are completely independent of groups. They therefore have a fixed position and - unless you use the designer-support commands -
vpr_DefBMP | Inserts bitmap graphic
vpr_DefFreeLine | Draws a given line
vpr_DefRect | Draws a rectangle
vpr_DefRndRect | Draws a rectangle with rounded corners
vpr_DefHLine | Draws a horizontal line at a given position
vpr_DefVLine | Makes a vertical line
vpr_DefHSep | Draws a horizontal line at the current cursor position (Separator)
Designer Support Commands
These commands are used to initialize (and re-initialize on each page) the objects defined in the Viper Designer
vpr_InitGraphObj | Initializes Designer Graphic objects.
vpr_InitImg |
vpr_InitLin |
vpr_InitRect |
Miscellanious Commands
Some commands that do rarely used magic that is not provided by Progress.
vpr_SaveClipboardToFile | Save the (graphical) contents of the clipboard to a file.
vpr_SaveWindowToFile | Save a given window to a file.


QUERY FUNCTIONS

QUERY FUNCTIONS AND COMMANDS

All query functionality is available in two forms: a function starting with "vpr_Get" and a procedure starting with "vpr_Fetch". The procedure returns the information using an OUTPUT parameter, while the function uses its return value for this purpose. The function API is only available if you have included it during deployment with the Assistant or by activating the vpf.i include file in the viper.vfcg file.
Query cell information
vpr_GetCellHeight vpr_FetchCellHeight | Obtains the cell height
vpr_GetCellHPos vpr_FetchCellHPos | Retrieves the horizontal position of a cell
vpr_GetCellLineCount vpr_FetchCellLineCount | Retrieves number of remaining lines in the cell
vpr_GetCellVPos vpr_FetchCellVPos | Obtains the vertical position of a cell
vpr_GetCellWidth vpr_FetchCellWidth | Obtains the cell width
vpr_GetCellTextHeigth vpr_FetchCellTextHeight | Obtains the height of the cell's text
vpr_GetCellTextWidth vpr_FetchCellTextWidth | Obtains the width of the cell's text
Query group information
vpr_GetGroupHeight vpr_FetchGroupHeight | Gives the group height
vpr_GetGroupVPos vpr_FetchGroupVPos | Retrieves the vertical position of a group
Query page information
vpr_GetPageNo vpr_FetchPageNo | Gives the number of pages in document
vpr_GetPageVPos vpr_FetchPageVPos | Obtains current cursor position
vpr_GetPageVSpace vpr_FetchPageVSpace | Gives an account of free space on page
Query misc information
vpr_GetPreviewStatus vpr_FetchPreviewStatus | Waits for a given time (milliseconds) and returns the current status of the preview windows (shown or hidden/closed)
vpr_GetPrinterAttrib vpr_FetchPrinterAttrib | Obtain some printer attributes, by now only paperheight und -width.


MISC-COMMANDS

We really didn't know, where to put these...
Formatting Support
Some helpers to ease the formatting of your texts.
vpr_Asc2RTF | Adds some RTF tags to normal text and escapes some control characters
vpr_ToRTF | Convert a string to a RTF sequence.
Clipboard Handling
Some clipboard handling functions that customers requested.
vpr_SaveClipboardToFile | Save the (graphical) contents of the clipboard to a file.
vpr_SaveWindowToFile | Save a given window to a file.


VIPER Designer

DESIGNER-COMMANDS

The Designer API consists of procedures which are located in main Viper file (viper.p).

vpr_LoadVFL
vpr_LoadVFR
vpr_LoadDB
vpr_ActivateReport
vpr_InitRect
vpr_InitLin
vpr_InitImg
vpr_InitGraphObj
vpr_InitGroups
vpr_DelGroups
vpr_RemoveReport


Documentation - Utilities

Viper Setup

In order to use the PDF conversion, you have to install a Postscript printer driver on your system. You can use any of the PS drivers that come with windows. In order to create colored PDF files, you have to install a driver that supports color printing, for example the "IBM Color Jetprinter PS" driver. If you rename the created printer entry to "PS-Printer" you don't need to change the Viper configuration file viper.vcfg (viper.ini).

Informations regarding Ghostscript are available here.

Viper makes use of a compile time configuration file viper.vcfg. This file is created during Viper deployment to your development area by Viper Assistant. For runtime configuration (at the customer's site) you can use the viper.ini file found in viper's base directory. This file is used for defining some properties of the PDF file conversion. These defines are described in the table below. (They are also commented in the viper.vcfg/ini files itself.)

Name | Meaning | Possible Values | Default
WEBPRTACTIVE | Should WebPrintDoc be used? Changing this to "ON" only makes sense if you use Viper with Webspeed. If it is switched to "ON" Viper tries to read some Webspeed include files, that are needed to print to the Webstream. *NOTE*: This has not been tested for quite some time and especially with newer versions of Webspeed. | ON / OFF | OFF
WEBPRT | The name of the postscript printer (-driver) to be used by Viper. (For vpr_WebPrintDoc and vpr_PrintPDF) |  | "PS-Printer"
VP_GSDIR | Path of your systems Ghostscript directory. This is set to the Ghostscript version that came with Viper. If you want to use your own installation of Ghostscript, for example to use Aladdin Ghostscript, you have to change this value accordingly. This may also be necessary if you move your Viper installation.. |  | VIPER-DIRECTORY\dist\gs
VP_GSEXE | This defines which Ghostscript executable to use (usually Ghostscript for Windows comes with two different executables, the command-line version "gswin32c.exe" and a version without console support "gswin32.exe". Keep the default, unless you know it better. |  | {&VP_GSDIR}\gswin32c.exe
VP_GSLIB | Stock Ghostscript splits exe, lib, and fonts into separate directories. This entry should point to the lib-directory. The version of GNU Ghostscript that comes with Viper uses a single directory approach. You would only need to change this, if you install a stock GS. |  | {&VP_GSDIR}
VP_FONTPATH | This allows you to add directories for additional fonts. The GS that comes with Viper has Ghostscript's standard fonts in the same directory as all other GS related files. In a stock Ghostscript installation this is a separate subdirectory called "fonts". You can also add additional directories, separated by ";". Usually this shouldn't be necessary because GS and Windows should already handle this properly. |  | {&VP_GSDIR}\fonts
VP_WEBTEMPDIR | vpr_WebPrintDoc copies the PDF files created into a special directory. VP_WEBTEMPDIR gives its path relativ to the Webspeed working directory. You can also use an absolute path here. Please ensure that both, Webspeed and the Webserver are able to reach this directory. |  | vpwebtmp\
VP_SRVTEMPDIR | This is the same physical directory as VP_WEBTEMPDIR, but this entry gives the path relativ to the server root of your website. This is used as part of an URL, so make sure you use "/" as directory delimiter. The default values for VP_WEBTEMPDIR and VP_SRVTEMPDIR assume that the server root directory is the same as the Webspeed working directory. |  | /vpwebtmp/


Utilities

Viper ships with three additional small helper programs

The first two tool help you gaining certain information about the local printing environment.

The third utility allows you to merge two Viper reports

Printers | Shows a list of the printers available on your system
Tray List | Shows informations on the paper trays supported by a certain printer
vprmerge | Merges two Viper reports.


Utilities

Printers

List the installed printers

Printers lists all printers that are installed on your system in a messagebox. The informations can be used with the vpr_SelectPrinter("Printername") command.


Viper 2.3 - Documentation - Utilities

TrayList

List the paper bins supported by a printer/printerdriver.

The program TrayList lists the papertray known to the printer driver. Ths information kann be used with the vpr_SetCurrentPageProperties ("Papertray","nnn") command, to control the paperbin used by each page.

Call: traylist "printername" "printerport"
In case of a network printer you have to give the network path. The program runs in a dos-box and lists the traynames followed by the traynumbers (needed by vpr_SetCurrentPageProperties). TrayList lists the paper trays reported by the printer driver, these may differ from the trays actually available on the printer.


Vprmerge

Vprmerge allows to merge two Viper reports

Usage:
vprmerge report1.vpr report2.vpr ... reportN.vpr mergeReport.vpr

Neither the command line parsing nor the program itself are very smart (though the program should at least warn you, if a file is not a *.vpr file or doesn't exist), so don't expect to much :-) Especially it simply disregards the default paper settings for the second report. Vprmerge is only capable of handling reports created with Viper 2.43 up to Viper 3.01. (It will most probably work with the newer version, too.)


Error Handling

All Viper commands use RETURN-ERROR to raise an error-condition if a severe error occurs. This error can be trapped using the usual Progress mechanisms. By now Viper only regards problems in the communication to the VIPER/VIPER32.EXE as a severe error. (For example if the .EXE is shut down by the user before the report is totally processed.)

Code example:

  DEF VAR l-error AS LOG NO-UNDO.
  SESSION :IMMEDIATE-DISPLAY = TRUE.
  DO ON ERROR UNDO, LEAVE:
    DO WHILE TIME - i < 10 :
      l-error = TRUE.
      RUN   vpr_GetPageVSpace  (OUTPUT l-pagevspace).
      DISPLAY l-pagevspace.
    END.
  l-error = FALSE.
  END.
  IF l-error THEN DISPLAY "Oops, something   went   wrong".
  IF  RETURN-Value <> "" THEN DISPLAY   RETURN-Value.


VIPER Preview UI

The User Interface of Viper's Preview

Screenshot of the Viper preview
[The Viper preview window]

The purpose of the Viper print preview is, to view the already finished pages on the screen before they are printed. The preview always shows all pages that have been finished with vpr_NewPage. Only the page which is currently edited isn't shown in this Viper version.

Additionaly the VprReader.exe program started with the vpr_ShowDoc command as persistent preview and used as stand-alone viewer for Viper's *.vpr files uses the same user interface (and are based on the same code).

The window is split into three major parts (not counting the window title and frame): At the top we find the button bar that allows to control the preview, at the bottom there is a small status line showing the page number of the currently displayed page and the number of available pages in the document.

The main part is the actual (pre-)view of the document. If a full page is displayed by the preview window, the right hand scrollbar allows you to scroll to the other pages. If only a part of a page is displayed (because of zooming) you can scroll inside the displayed page.

For most of the icon bar's actions, accelerator keys are available. For details see the table below.

To control the preview, e.g. looking through the pages, Viper uses the following toolbar and buttons.

Leider zeigt ihr Browser keine Bilder, sonst könnten Sie hier die Viper Toolbar sehen. Im folgenden werden die Button erklärt, in der Reihenfolge von Links nach Rechts

Icon | Accelerator Key | Action
Load Report | Ctrl+O | Load a Report ( *.vpr file ).
Save Report | Ctrl+S | Save a Report ( *.vpr file ).
 | Ctrl+Shift+P | Create a PDF (only available if PDF/GhostScript support is installed).
PrintPage |  | Prints the current page.
Print All |  | Print all pages that are already processed (including the one that is currently worked on).
Print Dialog | Ctrl+P | Print via dialog. Calls the printer dialog first, and then prints with the chosen values.
First Page | Home | Show first page.
< | PgUp | Show previous page.
> | PgDn | Show next page.
Last Page | End | Show last page.
 | Ctrl+1 | Toggles between 1 and 2 page mode.
Zoom In | Ctrl++ | Zoom in.
Zoom Out | Ctrl+- | Zoom out.
Help | F1 | Show Help/Aboutbox

The color and look of the buttons shows if the buttons are enabled at the moment. The buttons for browsing, for 1 and 2 page mode and for zooming are adjusted respective to the preview, this means on the last page no more browsing is possible. The buttons appear gray.


Known Bugs and Weaknesses

vpr_SetCellAlign

Block paragraph alignment is not yet supported, so for now, mode 4 functions as left alignment.

Fontparsing in RTF Mode

At the moment no font information out of paragraph styles is used. In some RTF documents ( for example from Star Office ) the font settings may not be considered. According to our tests, text from WordPad or other editors which use the Windows RTF widget will be utilized correctly. But nevertheless a reasonable default font for the cells should always be set (using vpr_SetCellFont). The standard default font for the cells is "Times New Roman" with 12pts height.

The font parsing can be deactivated in the Viper(32).ini file, which can be found in the Windows directory, by setting the rtf_level key in the [RTF Level] section to 0. A Viper.ini with a preset for the rtf_level will be generated at the first run of the new Viper version.


How to purchase VIPER

Informations concerning the purchase of a VIPER-licence and additional support licence are available on our Website using the URL http://www.tools4progress.com/ or via e-mail to info@tools4progress.com. It is also possible to contact us directly; our address is: IAP GmbH, Valentinskamp 30, 20355 Hamburg, Germany, tel +49-40-306803-0, fax +49-40-306803-10.

One licence allows one development-team/-department to develop printing-programs for one or more projects. The amount of so developed programs is unlimited. These programs could be delivered to your customers, there are no additional runtime-fees.

Range of the maintenance and support licence:
The licence contains telephonic and e-mail support and the right to receive further program-versions for free. Maintenance licences are to be purchased on a yearly basis. The distribution of new program versions is done via the web-server of the IAP GmbH, Hamburg, where new versions can be downloaded. For the distribution of new program versions on disk or other media additional fees (shipping and handling) will be imposed.


New Viper Stuff

What's new?

This section describes the changes in this release in comparison to the previous one.

Changes from 3.3.0 to 3.3.1

  • bugfix for vpr_SelectPrinter. Due to internal changes vpr_SelectPrinter executed a RETURN ERROR... when the selected printer wasn't available in 3.3.0. Now it is back to the previous (correct behaviour) and keeps the current selection. It also sets the RETURN VALUE to 2.
  • bugfix: rotated text now also supports character encodings/codepages
  • enhancement: during setup, if no standard printer can be found, Viper now first tries to set the printer to "PS-Printer", then "Microsoft XPS Document Writer", before finally falling back to the first printer in the systems printer list. This should avoid choosing an unsuitable driver (like a fax) in most cases.

Changes from 3.2 to 3.3

  • Changes for compatability with Windows 8 and Windows Server 2012
  • Additional version for use with 64bit OpenEdge
  • new command vpr_SetCellLongText uses LONGCHAR to set the cell's text.
  • new command vpr_SetCellRotation to rotate the text in a cell.
  • new command vpr_SetTempDir sets the temporary directory used by Viper.
  • new vpr_SetDocAttrib attribute DEFAULTGROUPCELLPOSITIONING to ease the migration from Viper 2.x
  • new commands vpr_GetGroupHPos, vpr_GetGroupWidth, and vpr_GetGroupObjects as well as their "fetch" vpr_FetchGroupHPos, vpr_FetchGroupWidth, and vpr_FetchGroupObjects counterparts allowing to retrieve some informations about a group
    • Bugfixes
    • Sometimes Viper could hang when it could not create a temporary directory or file.
    • In AppServer or Webspeed scenarios it could happen that two separate Viper instances tried to use the same temporary directory name, leading to broken viper documents
    • PDF creation from the preview now uses the full selected path to save the PDF.
    • "Special" characters in pathes are now handled more properly, so that dashes, blanks, etc in filenames should work now. In particular username with those character will not keep Viper from creating its temp-files in the default location (/Users/_USERNAME_/AppData/Local/Temp in Windows Vista/7/8) anymore
    • Some MessageBoxes have been removed to make it easier to work with AppServer or Webspeed
    • Viper Designer
    • The EdgePixels property is now correctly regarded and sets the linewidth attribute of the created rectangle
    • The element list is now sortable by its columns
    • The group of graphical objects has been added to the element list

(release history)


Migration

Migrating from older versions to Viper 3.x

Viper 3.0 got (by default) a new programming interface which is incompatible with the one used until version 2.44. It is not possible to migrate existing Viper applications by simply recompiling against the new Viper API.

In the compatibility (comp/) subdirectory of Viper3.0 installation there are viper.p and vreport.p files which provide old API access to Viper 3.x dlls. Also provided is an old Viper help file (viper.chm).

It is possible to benefit from Viper3.x 's ease of use (no registration and viper32.exe file needed any longer) and performance increase by replacing the viper321.dll file of an older Viper installation by viper32.dll file provided in the bin/ directory of Viper3.0 installation (and renaming it to viper321.dll). Some changes to your reports may be necessary due to some changes to Viper's defaults, its font handling and the cell background coloring.

Viper 3.x and older Viper installations may be used in parallel.

Additional functionality of future versions will only be accessible through the new API. As old and new Progress parts of Viper are provided in source code you could add support for new features to the old API yourself, though.


Release history

May 2015 - Version 3.3/July 2015 - Version 3.3.1

  • This Viper Version (What´s New?)

Changes from 3.1.1 to 3.2

  • Updated GNU Ghostscript to version 8.50
  • The printer name for vpr_SelectPrinter isn't case-sensitive anymore.
  • new command vpr_SetCellCodePage allowing to choose the code page Viper uses. Most notably this allows support of UTF8.
  • new commands vpr_GetCellTextHeight and vpr_GetCellTextWidth that calculate the height and width the text of a cell actually needs. (There are also vpr_Fetch... counterparts, as well)
  • new command vpr_SetPageVPos to set the current vertical position on the page (for example this allows to restart on the top of a page and print another column independently of what has already been printed).
  • new command vpr_SetDocAttrib. Currently two attributes exist: "createmode" and "papersize". See its documentation for details.
  • new commands vpr_SetGraphObj and vpr_SetGraphObjAttr allow to add and maintain graphical objects that are connected to groups. You should read the documentation.
  • new command vpr_SetGroupAttrib. Currently one attribute "fixed". Allows to fixate the position of group on the page. Such a group will not be considered when calculating and updating the current vertical position.
  • Viper can work without registering in the registry, if exe and dll reside in the same directory.
  • Fixed blank char width: The blank character has the same width as digits, now. This makes tabulating easier.
  • A PrintToPDF Button has been added to the preview. This should only be available, if GhostScript and a PS-Printer are installed.
  • Some additions to Designer OCX, allowing you to build your own custom Viper Designer.
  • Some documentation for the Designer OCX's API, helping you in building customized versions of the Designer.
  • More robust reading of keyfile: Occasionally problems with reading the Viper.key from a network drive where reported. Viper now tries opening the fail more than once before it fails. This looks like a problem either with SMB-network drives or with MS implementation of the fopen call.
  • Fix some problems with fixed fonts
  • Saving a .vpr (or .pdf) to doesn't change the working directory anymore. This sometimes lead to crashes and was not intended anyway.
  • Don't display the PDF icon when no GhostScript is available (hopefully :)
  • The paper orientation and size should now be set properly after a vpr_ResetDoc.
  • vpr_ResetDoc hides the preview. It's not sensible to preview a *non-existing* document, is it?

03.03.2003 - Version 3.1

    Changes from 3.0.1 to 3.1.1
  • new command vpr_ShowDoc (persistent preview)
  • new command vpr_ExportDoc (XSL-FO)
  • new command vpr_GetPreviewStatus() (wait for close of preview)
  • new function vpr_ToRTF
  • Viper Designer enhancements
  • BugFix: greyscale JPGs don't crash Viper anymore (instead Viper shows and prints them ;-)
  • BugFix: If the first line centered or right aligned, the cell was not printed correctly.
  • BugFix: Under W2K Viper sometimes crashed if started too often in a short period of time. (very strange problem with a printer handle)

19.04.2002 - Version 3.0

    Changes from 3.0 to 3.01
  • Viper dll for usage with Webspeed3.x available
  • Bug: Printbutton in preview crashes appl fixed
  • Bug: AutoWrap in Viper Designer fixed
  • Bug: some small change in Assistant
  • Bug: viper.ini fixed
    Changes from 2.4.4 to 3.0
  • faster processing due to dll only version
  • no viper32.exe registration needed anylonger
  • new Application Programming Interface (API, vpr_XXX)
  • replaced query procedures byFunctions
  • additional changes in Viper API calls
  • single (configurable) interface procedure (viper.p)
  • new Viper Designer (using special OCX for grahical stuff)
  • Viper Reader included (VprRead.exe)
  • Assistant for deployment included
  • new licence key necessary
  • skipped 16bit support

01.09.2001/23.11.2001 - Version 2.43/2.44

    Changes from 2.4.3 to 2.4.4
  • New command: SetDocTitle sets the title of the document. This is shown in the windows printer queue.
  • Bugfix: Right aligned text is now printed correctly in standard (non-RTF) cells.
  • Several other small bugfixes. For example a memory leak has been fixed.
  • Decreased the line height for standard cells a little bit, to avoid problems with some reports designed for older Viper versions.
  • Backwards browsing through a document now uses the page properties correctly.
  • There are new examples in the Demo application.
  • There are provided new .bat files for converting any Windows PS-printouts of any application into pdf or jpg (see Demo, context menu of ps-files).
    Changes from 2.4 to 2.43
  • Viper now has got a new more beautiful buttonbar. In the 32 Bit version Viper got flat buttons now.
  • Two new buttons in the preview for saving and loading of reports ( *.vpr Files).
  • In the preview a statusline has been added. It shows the current page number and the number of currently created pages.
  • New command: SetPaperSize (int width, int height) sets the size of the paper used for the document.
  • RTF cells now support changing the font within an document. It must be pointed out that at the moment no font information out of paragraph styles is used. In some RTF documents ( for example from Star Office ) the font settings may not be considered. After our tests, text from WordPad or other editors which use the Windows RTF widget will be utilized correctly. But nevertheless a reasonable default font for the cells should always be set (using vpr_SetCellFont). The standard default font for the cells is "Times New Roman" with 12pts height.

    The font parsing can be deactivated in the Viper(32).ini file, which can be found in the Windows directory, by setting the rtf_level key in the [RTF Level] section to 0. A Viper RTF with a preset for the rtf_level will be generated at the first run of the new Viper version.
  • Removed errors in LoadDoc and SaveDoc. Reports now are reloaded correctly. PageProperties are saved and reloaded with the reports. Because of this the usage of a new file format is introduced. Viper continues reading the old format but new generated *.vpr files cannot be read by older Viper versions.
  • Introducing two new PageProperties: Paperheight and Paperwidth.
    How to use:

     /* setting the pageheight to 100 mm */
     RUN vpr_SetCurrentPageProperties  ("Pageheight", "1000").

     /* setting the pagewidth to 100 mm */
     RUN vpr_SetCurrentPageProperties  ("Pagewidth", "1000").
    The width and height must be specified in 1/10 mm and can be set within the limits of the printer-driver. When these limits are exceeded the default-papersize of the printer will be set.
  • Removed error in ResetDoc. New documents are now processed correctly.
  • If available viper.cfg is read at runtime.

26.03.2001 - Version 2.4

    Changes from 2.31 to 2.4
  • New demo application included.
  • Usage of Windows (HTML)Helpsystem.
  • JPEG graphics format support.
  • Viper(32).exe can be used as a viewer for Viper (*.vpr) documents, by running Viper(32).exe with the document as argument or by double-clicking the document in the Windows Explorer (or something similar) (v2.32)
  • Some memory leaks have been fixed(v2.32)
  • Bugfix for LoadDoc: Under Windows NT/2000 BMPs have not been loaded correctly. (v2.321)
  • Fixed bug in ShowPreview: Sometimes the main application window has not been redrawn.(v2.33)
  • Fixed some bugs in documentation: SetPreviewMode, Known Bugs, PrintPDF
  • New command: GetCellWidth
  • Ghostscript is now started from within the DLL because of ressource/environment problems with OS-COMMAND or batch files.
  • PDF conversion now also supports landscape format (as before: A4 papersize only - needs changed gs_statd.ps as supplied by Viper).
  • Fixed bug SetPrinterAttrib, enlarged a buffer
  • Standard cells are now handled in the same way as RTF cells (except for the RTF parsing of course) and can therefore be used with the cell split functionality
  • Fixed some bugs in the rtf handling (esp. TABs should work much better)
  • Fixed bug in the documentation for SetPrinterAttrib. The qualifier "FileTo" should have been "FileName". Now both work, as well as "name".
  • New command: SetCellHeight sets the height of a cell.

27.04.2000 - Version 2.3

    Changes from 2.3 (version on our demo-CD) to 2.31
  • Bug removed: In cell "split" mode the last line was ignored, if it contained only a single word.
  • Allow blnaks in filenames/pathnames for PDF file creation.
  • Fixed two bugs in the docs: Asc2RTF und SetCellSplit
  • The viper.key work again with the 16 bit version.
  • 16 bit version now deletes its temporary directory, too.
  • SelectPrinter should work again in the 16 bit version.
    Changes from 2.2x to 2.3
  • Bug in SetCurrentPageProperties fixed, that could lead to a GPF in Windows NT.
  • PrintPDF and WebPrintDoc offer you away to save documents in the PDF format and some support for releasing documents in the www (using Webspeed)

03.11.1999 - Version 2.2

    Viper 2.2 to 2.21
  • Fixed bug in ResetDoc command
  • Fixed bug in RTF code with umlauts under WinNT (still not perfect, though)
  • Fixed bug in the RTF parser: The blanks used by RTF as delimiters are not printed anymore.
  • Print to file, without user interaction.
    New attributes for SetPrinterAttrib:
    • ToFile=TRUE/FALSE
    • FileName=filename.xxx
  • Corrected documentation on SetPrinterAttrib.
  • Select papertray on a per page basis. Paper orientation per page selectable.
    New command:
    RUN SetCurrentPageProperties IN h-viper ("Papertray", "No. of bin").
    und
    RUN SetCurrentPageProperties IN h-viper ("PaperOrientation", "portrait/landscape").

    New utility: "TrayList", Lists the paperbins.supported by the printer driver.
    Call: traylist "Printername" "Printerport"
    For network printers the network path has to be given. The program is started in a DOS-box and lists the tray names and numbers. The printer driver may list more trays then the printer actually has installed.
  • Bug in GetGroupHeight fixed, it returns the correct height, now.

05.08.1999 - Version 2.1

    Changes from 2.01 to 2.1
  • Viper now uses a swapping mechanism if more than 200 pages are processed. Thus huge reports can be printed without a ressource shortage.
    IMPORTANT: You need writing permissions for the temporary directories. (Viper uses the directory given in the environment variables TMP or TEMP or it uses the current working directory.)
  • The documentation for SetCellRTF has been fixed. Oooops. Viper.p has been changed in order to work as good as possible with the wrong syntax, too. (The correct syntax is of course recommended.)
  • Some ressources are freed a bit earlier now, trying to address a problem with Win3.1(1).
  • Umlauts in RTF should now be handled properly (I hope ;-)

03.05.1999/28.05.1999 - Version 2.0 and version 2.01

    Changes from 2.0 (distributed at the Users Conference in Boston) to 2.01
  • Pictures are correctly stretched, if you want the aspect ratio to be retained.
  • SaveDoc and OpenDoc work with RTF, too. And they are properly documented. now.
  • Bug in SetPreviewMode("PageByPage") fixed. It now works :-)
  • The cell position is now correctly reset after a NewPage, even if it has never been set by SetCellPos (to 0,0,0,0).
  • Occasionaly in wrap mode cells went a little beyond their boundaries. This is fixed.
  • Bug in cellsplit-code removed, that broke the word-wrapping in RTF mode unless you used cellsplit mode.
    Changes from 1.5x to 2.0
  • Print to File in the Printerdialog now works
  • If the printerdriver supports it, multiple copies of a document can now be printed using the printer dialog or a new command:

       RUN SetPrinterAttrib in h-viper ("copies=xxx,from=xxx,to=xxx").

  • SetCellAttrib now works if blanks are in the attribs
  • A bug SetGroupVPos that was "introduced" in version 1.5b is removed. (Sometimes cells were positioned in the wrong place after a NewPage)
  • GetGroupVPos now gives a meaningful value even before the first FlushGroup.
  • Save and load of Viper reports using
    RUN SaveDoc in h-viper ("FileName")
    and
    RUN OpenDoc in h-viper("FileName").
    NOTE: Only reports without embedded format can be printed
  • Bug under NT removed: linewidth and -style now works.
  • New function to query the papersize:
    RUN GetPrinterAttrib in h-viper ("Paperwidth, OUTPUT value).
    and
    RUN GetPrinterAttrib in h-viper ("Paperheight", OUTPUT value).
    return the corresponding values in value
  • You can switch off the printing-status window, in order to print without any user interaction:
    RUN PrintOptions in h-viper ("SHOWPRINTSTATUS","Off/On/NoCancel","","","").
    with
    On : status window active.
    Off: status window inactive.
    NoCancel: status windw without cancel button
  • The preview window comes to the foreground any time ShowWindow is called (problem under NT)
  • Cells only containig blanks now print blank lines in RTF mode, too.
  • Cells using enbedded formats now use RTF. Supported format attributes: blod, underline, strike, and italic. TABs are supported, too. Tabwidth is 1,5 cm.
  • Two new command for working with screen copys:
    SaveWindowToFile (Input HWND, Input AreaType, Input FileIn, Output FileOut)- saves the given window as DIB
    - HWND: Windowhandle of the window that should be saved.
    - AreaType: Save all of HWND or only clientarea? values: "ALL" or "WINDOW": save whole window (including menu, etc); "CLIENT": Save only the client area
    - FileIn: Filename to save the data to. if no FileIn is given (i.e. an empty string) a temporary file with a unique filename is chosen.
    - FileOut: returns the filename. empty if the procedure fails.

    SaveClipboardToFile(Input Type, Input FileIn, OUTPUT FileOut)- saves the clipboard contents
    - Type: defines the datatype to be saved. so far only bitmap ("BMP") and Device Independent Bitmap ("DIB") is supported
    - FileIn: Filename to save the data to. if no FileIn is given (i.e. an empty string) a temporary file with a unique filename is chosen.
    - FileOut: returns the filename. empty if the procedure fails.
  • It is now possible to change the way the cells are positioned on a FlushGroup. The default sets all cells to one horizontal line (the new position of the group). The other positioning style retains the relative position of the cells in the group
    command:
    RUN SetGroupCellPositioning IN h-viper ("Groupname", 0) sets the default mode
    RUN SetGroupCellPositioning IN h-viper ("Groupname", 1)enables retaining of relative group positions
  • SetCellSplit: You can "tell" RTF mode cells to keep the part of the text that does not fit in the cells rectangle and print it with the next FlushGroup. The command GetCellLineCount can query the remaining lines in the cell.
  • ShowDLLVersion: Shows a window telling you the compilation date of the DLL. (Helpful if you seem to have a version conflict)
  • SetCellBuffer, AddToCellBuffer, DeleteCellBuffer, and SubmitCellBuffer: A additional and independend (text-)buffer has been added to the cells. This buffer is not changed by any FlushGroup or NewPage commands and you can append text to it. This enables you to use texts even longer than Progress internal buffer size (default 32k AFAIK) by appending texts in chunks not bigger than the Progress buffer.
  • setWindowPos: sets the position of the preview window.
  • Viper now waits for the end of a printing process if you do a APPLY CLOSE TO HANDLE h-viper.
  • The internal size of the buffer used for printer names is enlarged and should be big enough for even *a lot* of printers (well, dynamic allocation would still be nicer, ok)
  • A bug in SetGroupVPos that occured if it was called several times, should be removed.

24.09.98 - Version 1.5d This was an english only version, released for the '98 Users Conference in London and has never been published on our website.

16.03.98 - Version 1.5c

  • Removed some bugs of version 1.5b
PrinterDialog now returns the correct value for the button pressed.
No post-mortem dump if you press ESC in the preview (NT 4.0)
SetGroupVPos did not work with Progress 8.2 under Winodws NT . This is fixed.
The preview remains hidden after printing a document, if it was hidden before. (i.e. in preview mode "direct" or after a HidePreview
  • Embedded format commands are added as a feature preview.

02.98 - Version 1.5b

Removed some bugs of version 1.5a
The printerdialog in the preview can now be canceled.
A messagebox that appeared if you pressed a key during printing, is removed.
New commands to enhance vipers speed and make it easier to use.
SetGroupTextsets the text for several cells in a group
SetDelimiter sets the delimiter for SetGroupText and internal use.
SetGroupVPos sets the vertical position of a group.
GetCellVPos gets the vertical position of a cell.
GetCellHPos retrieves the horizontal position of a cell.
GetGroupVPos gets the vertical position of a group.
EndDoc tells Viper that the document has ended.

09.01.98 - Version 1.5a

Printerselection and -control commands
SelectPrinter: Select printer to print on.
PrinterDialog: Call the printer dialog from Viper.
PrinterSetup: Call the printer-setup dialog with a Viper command.

Enhanced preview with new and better functionality
The user-interface of the preview has been enhanced:
  • New toolbar (looks better ;-)
  • Buttons to print the current page, all pages, or via printer dialog.
  • Buttons for moving forward and backward through the document and to go to first and last page.
All already processed pages are now available in the preview and new pages are added at every NewPage.

04.09.97
  • Coloured texts with SetCellColor to control Fore- and Backgroundcolour.
  • New Commands to control the preview window:
  • ShowPreview shows the preview window at any time.
  • HidePreview to hide the preview window at any time.
  • The errorhandling has been improved.
  • A speed up of about 10% compared to the versions of Aug, 28. and July, 7.
  • All in the meantime reported bugs have been fixed.

  • The errors were:
    • AutoResize mode did not reset the CellHeight after a FlushGroup
    • Depending on the driver settings the CellHeight sometimes was not calculated correctly.
    • Depending on the driver settings the last character of right-justified texts was sometimes cut.
    • PrintDoc used to print all pages, even if a selection was given.
28.07.97
32 bit Version of Viper released. This version works with Progress 8.2a. In all other respects it is fully compatible with 16 bit Viper. In mixed environments (16 and 32 bit) both versions can be used at the same time.
Some minor changes for OLE enhance working with Windows NT.
07.07.97
  • The internal communication structure of Viper is changed to the OLE-automation mechanism.
  • Viper now works with Windows NT as expected.
  • Some bugs have been removed.
  • Empty strings given as parameter used to rise a General Protection Fault. This is corrected.
  • DefVLine and DefHLine had wrong parameter definitions in viper.p and viper.i. They now work correct.
  • The viper keyfile had to reside in the working directory of the Progress application. From now on it has to stay in the same directory as the viper.exe, as one would expect.
  • A little speed-up was achieved.
  • During a NewPage the cell positions will be reset to the last value given by their corresponding SetCellPos. Thus you may not need to reset them for each page.
  • Addition to the documentation of DelCell: Using a "*" as cellname will delete all cells of the given group.
23.05.97
Third VIPER version released, including the possibility to purchase it and distribute the runtime-version with your own applications.
  • SetPreviewMode: Possibility to print without previewing.
  • SetPageOrientation: A Viper command for the option of printing as portrait or landscape, regardless of the windows default value.
  • SetCellWrap: The autowrap feature of the cells can now be switched on and off. By default it is turned off now.
  • DefRndRect is now working as expected and creates rectangles with rounded corners.
  • In some cases GetGroupHeight used to give back a wrong value. It's now working properly.
  • SetGroupSkip: Define a default blank space between logical lines of a group.
  • The handling of the RGB color parameter is improved. Instead of giving a value consisting of red+256*green+65536*blue you can now use the standard colors of Progress V6 oder a commaseperated list giving red, green and blue values. (see )
  • The font attributes italic, underline, strikeout and bold can now be given as a string instead of a number value.
Possibility to purchase VIPER to use it in your applications. (see How to purchase VIPER)
21.04.97
Second Viper-Beta published.
  • Several internal changes in Viper have been made
  • Particularly, a GDI memory leak which caused Viper not to free all the used ressources was removed. Altogether, the ressource use has been reduced.
  • DefBMP: Insertion of Bitmap graphics.
  • The Viper commands were reworked for more consistent names.
  • The documentation has been completely reworked and put into HTML-format.
  • improved and expanded demonstration programs.
21.03.97
First Viper-Beta published.


Viper Designer

Tools for Progress

Viper Designer (3.3)

This documentation covers the Viper Designer. For documentation on the Viper command language click here.

  • What is the Viper Designer
  • Installation
  • Using the Designer
  • Designer API
  • Customization
  • Which versions of Progress are supported?
  • HowTo
  • About
  • Release history and "What's new"

© IAP GmbH 2002-2015


VIPER Frame Designe

What is the VIPER Designer?

The Viper Designer (VFD - from its previous name Viper Frame Designer) is a part of the Viper tool chain. It gives you the ability to interactively design report layouts for Viper. Some of its features are:

  • Create every type of Viper object, move them on the screen, resize them and edit their attributes
  • Get a preview of the report
  • Give the user the features to change reports after deployment. If the user changes some parts of the report, no recompiling of your source is needed!
  • Easily launch a report from a Progress program
  • Store report layout either in filesystem or connected repository (database, df file is provided)
  • copy/paste layout elements (even between reports)
  • paste fields from (PCase) ERD or structure view as cells
  • select elements using element list dialog

Viper Designer
[Screenshot of the Viper Designer]

The Desigener creates layout "templates" for use with the Viper 4GL enhancement for Progress. Following Viper's philosophy of keeping the things under your control, it does not "magically" create the whole report logic. Instead this is done in the Progress 4GL using normal Viper commands (some of them being specific to the Designer).

We repeat: The VFD will NOT create your 4GL report logic! It will help you, to maintain your report designs.

VFD ElementList
[The Designer's element list]


VFD Installation

Installation

The VFD is installed during installation of Viper.

The VFD's Progress files are not compiled. That's a feature. You can use your Progress version to compile the files and we don't have to worry about your version ;-)

The VFD is written in Progress 4GL using an OCX for graphical output. The OCX is installed in the vfd/ocx subdirectory of your Viper installation. It is registered by the installation procedure. After moving it or if the initial registration failed, you have to manually register the ocx. (You have to have sufficient user rights to change the registry). The registration can be done by executing: regsvr32.exe vfd.ocx or the "regocx.bat" file in the VFD subdirectory of your Viper installation.(The ocx uses mfc71.dll, msvcr71.dll, msvcp71.dll.)


Viper Designer - Designer Usage

Designer Usage

Using the Designer to design layouts (overview)
The Main Menu
The Right-Click Menu
The Report Properties Dialog
The Group Properties Dialog
Cell And Text (Label) Properties Dialogs
Image, Rectangle, And Line Properties Dialogs
The Set Font Dialog
The Element List
The Group List


Viper Designer - Using the Designer

Using the Designer to create report layouts

Creating a new report layout

When you start the Designer, it appears with an empty workspace, initially no document is open or created. To start a new report, choose File->New from the main menu or click on the new document icon icon.

This will bring up the Report Properties dialog box, allowing you to set properties like the name of your layout, the paper size etc:

the report properties dialog
[The report properties dialog]

Choose a name to your taste under "Name:", select the paper size under "Size:" and the orientation at the fittingly "Orientation:" named radio-set. Under the "Grid Unit Size:" heading you can choose the width (in pixel) of the grid to which the elements in the document window may snap. Finally you can add a comment. Pretty obvious that, right?

When you are done, choose "OK". You will be awarded with an empty document window like this:

The Designer with an empty document

Adding contents

Now you can add your cells, texts (labels), and graphical objects to the report, change their position and properties, define groups or shorter: define the layout for your report.

You can:

  1. Add new elements by: Choosing Edit->New->[Cell|Text|Rectangle|Line|Image] or by using the context menu (you'll find the "New" submenu there as well) or by clicking on the appropriate icon. (details below).
  2. Add new groups: Choose New->Group either from the context menu or the Edit entry from the main menu or click on the group icon. (details below)
  3. Select elements by clicking on them.
  4. Change element properties by double clicking an element.
  5. Move elements by clicking and dragging them.
  6. Resize elements by selecting them and then dragging their edges.
  7. Select a bunch of elements using a rectangular selection area by clicking into empty space and dragging the cursor with the left mouse button held.
  8. Cut, copy, and paste elements by choosing the appropriate entry from the context menu or using the usual accelerator key combinations: Ctrl+x (cut), Ctrl+c (copy), Ctrl+v (paste).
  9. Open a context menu by right clicking.
  10. Show the "Element list" by choosing it from the "Edit" submenu or from the context menu. You can use this to select elements or to change their properties. It also allows you to select and work on elements that are hidden by others.
  11. Show the "Group list" by choosing it from the "Edit" submenu or from the context menu. Here you get an overview of the already existing groups and you can change their properties or add new ones.
  12. Start a preview of your report layout: Choose "Preview" from the context menu or from the "File" submenu or by pressing the "F2"-key.
  13. Change the zoom factor, toggle grid and ruler display in the "View" submenu.
  14. Start some common Progress tools in the Tools menu: Progress Help, Progress Editor, Data Dictionary, Data Administration, and Set Propath.
  15. Of course you can also load and save layouts under the File submenu. Two ways of storing your templates are fully supported: *.vfr files and saving the layouts to a (connected) database. For the DB method a df-file is shipped with Viper.

When you are done with these 15 exciting things to do with the Viper Designer and probably some more things you find ;-) you might end up with something like this:

When you are done

If the result suits your needs, save it to the appropriate format (DB or *.vfr-file). For informations about using a layout with a Viper report program see this section.


Viper Designer - Main menu structure

The main menu

This section lists and explains all menu items of the Designers main menu.

Main entry | Menu item | Sub item | Short- Cut | Explanation
File |  |  |  |
 | New |  | Ctrl+N | Creates a new Designer document.
 | Open VFR |  | Ctrl+O | Opens a document saved in a *.vfr file (or imports layouts from the old *.vfl format).
 | Open DB |  |  | Opens a document saved in a connected DB.
 | Close |  |  | Closes the currently active document.
 | Save |  | Ctrl+S | Saves the currently active document.
 | Save As | -> |  |
 |  | VFR |  | Saves the current document to a *.vfr file.
 |  | DB |  | Stores the current document to a connected DB.
 | Import | -> |  |
 |  | Dump |  | Imports a dump file of a layout template. (The dump file is a DB dump of the temp-tables used by the designer to store the layout information.)
 | Export | -> |  |
 |  | XML |  | Stores the current document in an XML format. You may create XSLTs to convert this to other formats
 |  | Dump |  | Saves a dump file of a layout template. (The dump file is a DB dump of the temp-tables used by the designer to store the layout information.)
 |  | XSL-FO |  | Creates an XSL-FO file from the report template. This can be helpful for documentation purposes.
 | Show Preview |  | F2, Ctrl+P | Shows a preview of the layout. This fills the cells with dummy values and calls Viper to show the preview.
 | Quit |  | Alt+F4 | Quits the Designer.
Edit |  |  |  |
 | Undo |  | Ctrl-Z | Undo the previous action. The Designer has full undo support, so repeatedly using undo will undo more.
 | Redo |  | Ctrl-Y | Undo the undo. If there is more than one entry in the undo list, you can redo all.
 | Edit Report |  | Ctrl+Alt+P | Displays the Report Properties dialog, allowing you to set some report properties. (Name, Paper size, Grid Unit Size, Comment)
 | Edit Group |  |  | Displays the Group Properties dialog for the group of the last selected cell (it's more intuitive than it sounds).
 | Set Font |  |  | Displays the Set Font dialog, allowing you to setup the internal font table that the Designer uses.
 | New | -> |  |
 |  | Group | Ctrl+Alt+G | Creates a new group and display its Group Properties dialog.
 |  | Cell | Ctrl+Alt+C | Creates a new cell, giving it some default values.
 |  | Text | Ctrl+Alt+T | Creates a new text-cell (a label), giving it some default values.
 |  | Rectangle | Ctrl+Alt+R | Creates a new rectangle object, giving it some default values.
 |  | Line | Ctrl+Alt+L | Creates a new line object, giving it some default values.
 |  | Image | Ctrl+Alt+I | Creates a new image object, giving it some default values.
 | Delete |  | <Del> | Deletes the currently selected element.
 | Element List |  | Ctrl+E | Displays the Element List, listing all elements in the document.
 | Group List |  | Ctrl+G | Displays the Group List, listing all groups in the document
View |  |  |  |
 | Zoom | -> |  |
 |  | 50% | Ctrl+0 | Displays the layout at 50% zoom factor.
 |  | 100% | Ctrl+1 | Displays the layout at 100% zoom factor.
 |  | 200% | Ctrl+2 | Displays the layout with a zoom factor of 200%
 | Grid |  |  | Toggles the display of the (snapping) grid points to help you positioning the elements.
 | Ruler |  |  | Toggles the ruler on and off.
Tools |  |  |  |
 | Progress Help |  |  | Starts the Progress help.
 | Progress Editor |  |  | Starts a Progress editor session.
 | Data Dictionary |  |  | Starts the Progress Data Dictionary.
 | Data Admin |  |  | Starts the Progress Data Administration tool.
 | Set PROPATH |  |  | Allows you to set the PROPATH.
Window |  |  |  |
 | Tile |  |  | Shows all open documents tiled over the workspace.
 | Cascade |  |  | Cascades all open documents.
 | [Names of open documents] |  |  | Below the former two menu entries, you find a list of the open documents, enabling you to set the current one.
Help |  |  |  |
 | Contents |  |  | Displays this help file.
 | About |  |  | Shows a very small "About" box.


Viper Designer - Right-Click Menu

The Right-Click Menu

Right-clicking on the document area opens the Designers right-click menu:

The right-click menu

The menu allows a fast access to the most important and used Designer functions. Most of the functions are also available through the "Edit" entry of the main menu.

Menu item | Sub item | Short- Cut | Explanation
Properties |  | <Return> | Shows the property dialog of the currently selected element. This can be one of: cell properties, text properties, image properties, rectangle properties, and line properties depending on the type of the currently selected element.
Edit Report |  | Ctrl+Alt+P | Displays the Report Properties dialog, allowing you to set some report properties. (Name, Paper size, Grid Unit Size, Comment)
Edit Group |  |  | Displays the Group Properties dialog for the group of the last selected cell (it's more intuitive than it sounds).
Set Font |  |  | Displays the Set Font dialog, allowing you to setup the Designer's internal font table.
New | -> |  |
 | Group | Ctrl+Alt+G | Creates a new group and display its Group Properties dialog.
 | Cell | Ctrl+Alt+C | Creates a new cell, giving it some default values.
 | Text | Ctrl+Alt+T | Creates a new text-cell (a label), giving it some default values.
 | Rectangle | Ctrl+Alt+R | Creates a new rectangle object, giving it some default values.
 | Line | Ctrl+Alt+L | Creates a new line object, giving it some default values.
 | Image | Ctrl+Alt+I | Creates a new image object, giving it some default values.
Delete |  | <Del> | Delete sthe currently selected element.
Preview |  | F2, Ctrl+P | Shows a preview of the layout. This fills the cells with dummy values and calls Viper to show the preview.
Element List |  | Ctrl+E | Displays the Element List, listing all elements in the document and allowing you to select them or to display their property dialogs.
Group List |  | Ctrl+G | Displays the Group List, listing all currently defined groups and allowing to display their property dialogs and add new ones. See also Group Properties dialog.
Cut |  | Ctrl+X | Cuts out the currently selected element(s), putting them into the clipboard.
Copy |  | Ctrl+C | Copies the currently selected element(s) to the clipboard.
Paste |  | Ctrl+V | Pastes elements from the clipboard


Viper Designer - Report Properties Dialog

Report Properties Dialog

This dialog is used to set some of the basic properties of your report template.

The report properties dialog
[The Report Properties Dialog]

Field | Explanation
Name | The name of the report. If you are using *.vfr files to save the report, this is distinct from the filename.
Size | The paper size used for this report layout.
Orientation | Sets if portrait or landscape paper orientation should be used.
Grid Unit Size | Distance of the grid points in pixels. The layout elements can snap to these grid points helping you to position them.
Show every nth grid point. | Sets how many of the grid points should be displayed, if the grid is enabled.
Comments | Allows you to write an arbitrary comment about this report layout.


Viper Designer - Group Properties Dialog

Group Properties Dialog

The Group Properties dialog enables you to set the properties of a group.

The group properties dialog
[The Group Properties dialog]

Field | Explanation
Name | The name of the group.
PreSkip | The amount of space added before the new position of the group after a vpr_FlushGroup. See vpr_SetGroupSkip.
PostSkip | The amount of space added behind the current position of the group if vpr_FlushGroup is called. See vpr_SetGroupSkip.
Units | The unit used for the skips. Either 1/10 of a mm or typographical points. See vpr_SetGroupSkip.
Keep relative cell positions | Set if the relative position of the cells inside the group should be retained after a vpr_FlushGroup or if they should be aligned with the same line. See vpr_SetGroupCellPositioning.


Viper Designer - Cell Properties Dialog

Cell and Text Properties Dialog

The following section describes the cell and text property dialogs. These dialogs are used to set the properties of cell and text elements of your report layout. The two dialogs are the same to most extend. The only difference is, that it is not possible to set a text for a cell and therefore the corresponding field is disabled.

The cell properties dialog
[The cell properties dialog]

The text properties dialog
[The text properties dialog]

Field | Explanation
Name | The name of the cell or text label.
Text Value | The text displayed as the label (only applicable for text label. Inactive for normal cells).
Group | The name of the group this cell/text belongs to.
X | The horizontal position of the cell/text label.
Y | The vertical position of the cell/text label.
Width | The width of the cell or text label.
Height | The height of the cell or text label.
Alignment | The text alignment of the cell or text label. Available values: left, right, centered. See vpr_SetCellAlign
RTF allowed | Controls if RTF parsing is enabled for this cell or text label. See vpr_SetCellRTF
Autowrap | Should the text of the cell or label be wrapped automatically? See vpr_SetCellWrap
Auto-resize cell (vertical direction) | Set if the cell height will be automatically adjusted to fit the whole text. See vpr_SetCellAutoResize
Foregroundcolor | Set the color of the cells or labels text. See vpr_SetCellColor
Backgroundcolor | Set the color of the cells or labels background. See vpr_SetCellColor
Font | Set the cells or labels font. Also see vpr_SetCellFont


Viper Designer - Graphics Property Dialogs

Graphics Properties Dialogs

Image Properties Dialog

The Image Properties dialog is used to set the properties of images used in your report design.

The image properties dialog
[The Image Properties dialog]

Field | Explanation
Name | The name of the image.
Image | Path to the image file. Also see: vpr_DefBMP, vpr_SetGraphObj, and vpr_SetGraphObjAttrib
Group | The name of the group this image belongs to. A "[ --- ]" shows that this image doesn't belong to a group. It will be created using vpr_DefBMP.
Adjust image to size | Should the image be resized the size it is set to? If not set, the image uses the original size.
Maintain x/y ratio if adjusted | If resizing occurs, should the width/height ratio of the image be kept?
X | The horizontal position of the image.
Y | The vertical position of the image.
Width | The width of the image.
Height | The height of the image.
zOrder | The zOrder of the image (i.e. the layer). This is only applicable to grouped images, images that do not belong to a group have a zOrder of 1. See vpr_SetGraphObj or vpr_SetGraphObjAttrib for details.

Rectangle Properties Dialog

The Rectangles Properties dialog is used to set the properties of rectangles used in your report design.

The rectangle properties dialog
[The Rectangle Properties dialog]

Field | Explanation
Name | The name of the element.
Rounded Rectangle | Set if the "rectangle" has rounded corners.
Filled | Set if the rectangle should be filled with its color or if only the border should be painted.
Group | The name of the group this element belongs to. A "[ --- ]" shows that it doesn't belong to a group, in which case it will be created using vpr_DefRect or vpr_DefRndRect.
Edge Pixels | Number of pixels used to draw the border. Only has meaning for unfilled rectangles.
Color | The color of the rectangle.
X | The horizontal position of the element.
Y | The vertical position of the element.
Width | The width of the element.
Height | The height of the element.
zOrder | The zOrder of the rectangle (i.e. the layer). This is only applicable to grouped elements, rectangles that do not belong to a group have a zOrder of 500. See vpr_SetGraphObj or vpr_SetGraphObjAttrib for details.

Line Properties Dialog

The Line Properties dialog is used to set the properties of lines used in your report design.

The line properties dialog
[The Line Properties dialog]

Field | Explanation
Name | The name of the element.
Group | The name of the group this line belongs to. A "[ --- ]" shows that it doesn't belong to any group, in this case it will be created using vpr_DefHLine or vpr_DefVLine.
Color | The color of the rectangle.
Style | The line style. See vpr_DefHLine or vpr_DefVLine for details. Only meaningful for lines that are 1 pixel thick.
Direction | Set if it is a horizontal or vertical line.
X | The horizontal position of the element.
Y | The vertical position of the element.
Width | The width of the element.
Height | The height of the element.
zOrder | The zOrder of the element (i.e. the layer). This is only applicable to grouped elements, lines that do not belong to a group have a zOrder of 500. See vpr_SetGraphObj or vpr_SetGraphObjAttrib for details.


Viper Designer - SetFont Dialog

Set Font Dialog

With the Set Font dialog, you can select the fonts available for your report template. Up to 16 different fonts can be chosen this way. The advantage of this approach is, that it allows you to use a certain font number (let's say: font 1) with a certain type of cells (say, all cells with numbers) and easily change the font for all those cells at once - you know the idea. The disadvantage is of course that you need to define the fonts before you can use them.

the set font dialog
[The Set Font Dialog]

To choose a certain font for an entry in the font table, click the Set Font button on the same line. The standard Windows font dialog:

the windows font dialog
[The Windows Font Dialog]
(Sorry that it's the german one, but my system doesn't know it better
- if anyone can send us a screenshot of the english version, we will love to include that one!)

will pop up and allow you to select the font you want. Well, if it is available on your system.


Viper Designer - Elementlist

The Element List

The Element List displays a list of all elements currently used in the report. You can select elements by clicking on their names. To select multiple elements hold down the CTRL or the SHIFT key while clicking. SHIFT selects all elements between the first highlighted element and the one you clicked on, while CTRL adds the element you click to the highlighted ones. Choosing the Properties button displays the properties dialog for the last clicked element. Choosing OK selects the highlighted elements and closes the list.

You can order the list by clicking on the headers of the "Name" and "Group" columns.

The element list
[The Element List]


Viper Designer - Grouplist

The Group List

The Group List displays a list of all currently defined groups. Choosing the Properties button opens the Group Properties dialog. Choosing the Add Group button creates a new group and opens the Group Properties dialog for it.

The group list
[The Group List]


Designer Customisation

Designer Customization

The Viper Designer is written in Progress 4GL using an OCX (vfd.ocx) for the graphical part. The Progress part is provided in sources and could be adjusted to your own needs.
In the following the API of the vfd.ocx is described that could be used in your own application, see also sample MyVFD (in <ViperDir>examples\EXAMPLE\myvfd\myvfd.w)

Customized Viper Designer

Low-Level VFD.OCX API

Using control frame "PVFD" for the vfd.ocx (<VIPERDIR>examples\vfd\OCX\) is assumed.

Attributes:

  • chPVFD:VFD:zoom = <0.5|1.0|2.0>
    Sets zoom level in view

  • chPVFD:VFD:grid = <yes|no>
    Switches grid in view

  • chPVFD:VFD:ruler = <yes|no>
    Switches ruler in view

  • chPVFD:VFD:showScrollBars = <yesno>
    Enable/dsiable scrollbars

  • chPVFD:VFD:customPopup = <POPUP-MENU:HWND>
    Overwrite internal by customized popup menu

Methods:

  • chPVFD:VFD:IFSetFileName(<path>,<"LAN"|"IMAGE"|"PROPATH")
    "LAN": sets editable language file used (english.txt) for the labels of the VFD dialogs
    "IMAGE": sets filename for the default image (new) file used
    "PROPATH": allows using relative pathnames towards propath from within vfd.ocx

  • chPVFD:VFD:IFDelimiter(<delimiter>).
    Delimiter used for lists in parameters.

  • chPVFD:VFD:IFShowElementList().
    Opens Elementlist dialog.

  • chPVFD:VFD:IFOpenRptDlg().
    Opens Report dialog.

  • chPVFD:VFD:IFOpenGrpDlg().
    Opens group dialog.

  • chPVFD:VFD:IFOpenFontDlg().
    Opens Font dialog.

  • chPVFD:VFD:IFNewGroup(<yes|no>)
    chPVFD:VFD:IFNewCell(<yes|no>)
    chPVFD:VFD:IFNewText(<yes|no>).
    chPVFD:VFD:IFNewLine(<yes|no>)
    chPVFD:VFD:IFNewRectangle(<yes|no>)
    chPVFD:VFD:IFNewImage(<yes|no>)
    yes for imediate refresh. Returns object id for using attribute methods.

  • chPVFD:VFD:IFDelete()
    Deletes selected objects.

  • chPVFD:VFD:IFUndo()
    Undos last action.

  • chPVFD:VFD:IFRedo()
    Redos last action.

  • chPVFD:VFD:IFCut().
chPVFD:VFD:IFCopy()
chPVFD:VFD:IFPaste()
cut&paste from to system
    Clipboard

  • chPVFD:VFD:Refresh().
    Redraws objects in view.

  • chPVFD:VFD:IFSetFont(ii,FontAttr).
    sets font attributes

  • chPVFD:VFD:IFSetReportAttr(AttrLst)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "Name="
    "Rem="
    "gridWidth="
    "gridHeight="
    "gridV="
    "gridH="
    "width="
    "height="
    "orientation=" ("portrait"|"landscape")
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFSetImageAttr(image object id,AttrLst)
    image object id: generated by chPVFD:VFD:IFNewImage(false)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "name="
    "filepath="
    "x="
    "y="
    "Width="
    "Height="
    "adjust="
    "maintain=" (Ratio)
    "ImgType="
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFSetGroupAttr(group object id,AttrLst)
    group object id: generated by chPVFD:VFD:IFNewGroup(false)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "Name="
    "PreSkip="
    "PostSkip="
    "Unit="
    "relativeCellPos="
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFSetCellAttr(Cell object id,AttrLst)
    cell object id: generated by chPVFD:VFD:IFNewCell(false)
    chPVFD:VFD:IFSetTextAttr(Cell object id,AttrLst)
    text object id: generated by chPVFD:VFD:IFNewText(false)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "name="
    "x="
    "y="
    "Width="
    "Height="
    "Group=" (group object id)
    "GroupName=" (group name)
    "Alignment=
    "RTFallowed= "
    "Autowrap="
    "AutoResizeCell="
    "textvalue="
    "ForegroundColor="
    "BackgroundColor="
    "Font=fontDef"
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFSetLineAttr(Line object id,AttrLst)
    Line object id: generated by chPVFD:VFD:IFNewLine(false)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "name="
    "x="
    "y="
    "Width="
    "Height="
    "direction=" <"vertical"|"horizontal">
    "style=" "Color="
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFSetRectangleAttr(Rectangle object id,AttrLst)
    Rectangle object id: generated by chPVFD:VFD:IFNewRectangle(false)
    AttrLst: Delimiter separated Key/Value List allowing following keys
    "name="
    "x="
    "y="
    "Width="
    "Height="
    "roundrect="
    "filled="
    "edge="
    "FilledColor="
    "Private-Data="
    "Order="

  • chPVFD:VFD:IFGetReportAttr()
    Returns delimiter separated Key/Value list of attributes (analogous to IFSet...)

  • chPVFD:VFD:IFGetFont(ii)
    Returns font attributed of font ii.

  • chPVFD:VFD:IFGetLines()
    chPVFD:VFD:IFGetImages()
    chPVFD:VFD:IFGetRectangles()
    chPVFD:VFD:IFGetGroups()
    chPVFD:VFD:IFGetCellsOfGroup(group object id)
    chPVFD:VFD:IFGetTextsOfGroup(group object id)
    Returns delimeter separated list of object ids (of object type and group)

  • chPVFD:VFD:IFGetLineAttr(object id)
    chPVFD:VFD:IFGetImageAttr(object id)
    chPVFD:VFD:IFGetrectangleAttr(object id)
    chPVFD:VFD:IFGetGroupAttr(object id)
    chPVFD:VFD:IFGetCellAttr(object id)
    chPVFD:VFD:IFGetTextAttr(object id)
    Returns delimiter separated Key/Value list of attributes of defined object (analogous to IFSet...)

Events:

  • PROCEDURE PVFD.VFD.MouseDown :
    DEFINE INPUT PARAMETER pp-Button AS INT.
    DEFINE INPUT PARAMETER pp-Shift AS INT.
    DEFINE INPUT PARAMETER pp-x AS INT.
    DEFINE INPUT PARAMETER pp-y AS INT.
    fires on mouse click

  • PROCEDURE PVFD.VFD.Preview
    fires when context menu preview is choosen

  • PROCEDURE PVFD.VFD.KeyIsDown:
    DEFINE INPUT PARAMETER p-key AS INT.
    DEFINE INPUT PARAMETER p-shift AS INT.
    fires on key pressed

  • PROCEDURE PVFD.VFD.SysKeyIsDown:
    DEFINE INPUT PARAMETER p-key AS INT.
    DEFINE INPUT PARAMETER p-shift AS INT.
    fires on system key pressed

  • PROCEDURE PVFD.VFD.modified
    fires when anything is modified

High-Level v0020oth API

By including following frame designer file you may use additional high level designer API procedures.

&SCOP path vfd/vfd/v0020oth &SCOP t "~002"
&SCOP vpr_wt_shared NEW SHARED { {&Path}.sec &sec =
def }
{vpr.i INIT}
{vpr.i START}

RUN setParent (INPUT THIS-PROCEDURE:HANDLE).
RUN setViper (INPUT {&vpr_handle}).

Procedures

  • PROCEDURE openReport
    TempTable -> OCX
    Displays current (l-report) report

  • PROCEDURE saveReport
    OCX -> TempTable
    Stores current (l-report) report.
    (If l-mode = "NEW" a new report is created first).


VIPER Designer

Which versions of Progress are supported?

The Viper Designer itself is running in v9.1E or higher. There will be no 16-bit versions as it uses an OCX for graphical stuff.
But the generated reports could be started from Progress/OpenEdge versions supported by Viper..


VIPER Designer

How To ...

What happens in the preview

The Viper Designer uses Preview functionality of Viper. All cells will be realized and get their name as value (So that you can see them).
All text elements will be realized and get their value as value.
All rectangles will be created.
All images will be created.
All lines will be created.

How to read the Viper Designer Report files (*.vfr)

The Report files are simple text-files. You can read them with a text editor.
They contain lines which have the structure 'key=value'
Some of these lines are defining begin and end of objects, e.g. 'BeginObject=Report' (there is always an 'EndObject' if there is a 'BeginObject')
The other lines define some attributs for the objects, e.g. 'Name=Report1#.

If you feel the need, you can change some lines with an editor (be careful).


VIPER Frame Designer

About the creators of the Frame Designer

This Product is from:
© 1997 - 2015 IAP GmbH, Valentinskamp 30, 20355 Hamburg, Germany
Tel.: +49-40-30 68 03 - 0, Fax: -10

WWW: http://tools4progress.com or http://www.iap.de

If you have comments or suggestions, please feel free and send a mail to:

EMAIL: Info@tools4progress.com


VIPER Designer

Release history!

V1.0 - 16 Apr 02

Initial release.
Rewrite of completly Progress based Viper Frame Designer using MDI container written in Progress4GL that uses OCX for graphical stuff.

V1.1 - 03 Mar 03

  • additional access to elements using elementlist
  • improved db based storage,
  • added shortcuts ctrl-s/n/o/c/v, buttonbar
  • copy/paste layout elements
  • paste fields from PCase as cells
  • propath editor
  • some bugfixes
  • support transparent cell background
  • background images do not hide cell, texts, rectangles or lines anymore
  • texts are now wrapped in the layout mode, if requested

V3.2 rc1 - 24 Aug 05

  • group attribute for graphical elements
  • zOrder attribute for graphical elements
  • fix crash when Edit Group was clicked in the main menu but no group has been created in a new report (i.e. if it was chosen before any element was created in the document)
  • new group list listing all available groups, allowing to create and maintain groups
  • new icons for the element list
  • Fixed focus and selection marks: also works for rectangles and images now
  • If an element has the focus and you click on the area covered by it, it will always keep the focus, no matter if there is another element on top of it.
  • The element list now focusses a selected element, if it is the only element chosen (instead of just selecting it). In conjunction with the above point, this allows to focus and move elements that are completely hidden by other elements. (This can happen to images, because all other elements are on top of them.)
  • Added lots of paper sizes to the Edit Report dialog box
  • Added a couple of accelerator keys. See main menu and right-rlick menu.

V3.2 - 22 Feb 06

  • Synchronized paper type list with Viper. (So they can properly work together)
  • vpr_InitDoc now sets the paper size according to the one chosen in the Designer
  • Properly retrieve the zOrder setting for lines and rectangles from their property dialogs
  • Enlarged paper type selection box
  • Choosing "cancel" in the dialog for a new report now really cancels the creation of the report
  • Support for mouse wheel scrolling (yes it's a small change, but very nice)
  • If you cancel the "save file to" dialog when closing a new and unsafed report template, the report isn't closed unsaved anymore (and your changes are therefore not lost anymore :). Instead the whole action is canceled, as one would expect.

V3.3 - Dec 14

  • The EdgePixels property is now correctly regarded and sets the linewidth attribute of the created rectangle
  • The element list is now sortable by its columns
  • The group of graphical objects has been added to the element list


Viper Assist

Viper Assist (1.0)

Tools for Progress

Viper Assist (1.0)

The Viper Assistant helps you in deploying Viper to your Progress project. You may use it for configuring different aspects of Viper and copying needed files to your development source tree of the Progress application that will use Viper for printing.

Tools for Progress

In the main dialog page you may enter the destination path which is the directory where the sourcecode of your Progress application is put. (The main directory of the application that will use Viper for printing.
StartCopy initiates generating and copying needed Viper files to the destination directory.
Pressing buttons next or previous changes shown page. There are two additional pages for configuring some aspects of Viper and one summarizing actions that will be executed on pressing StartCopy button.

Tools for Progress

The second dialog page allows you to enable and configure PS and PDF functionality. Viper uses Ghostscript for generating PDF, on enabling the gs-subdirectory (8MB) will be copied and configuration files adjusted. Besides you may enable Web printing, this adds Webspeed code to Viper.p.

Tools for Progress

The third dialog page allows you to set the subdirectory name where the Viper files should be put. Additionally you may configure if Function-API and /or Viper Designer functionality should be available in your destination application. (Unselecting functionality leeds to smaller main viper.p file.)

© IAP GmbH 2002-2015


OLD COMMAND NEW COMMAND EXPLANATION
DefBMP
(CHAR filename, INT links, INT oben, INT breite, INT höhe, LOGICAL adjust, LOGICAL ratio) 		DefBMP
(CHAR filename, INT links, INT oben, INT breite, INT höhe, CHAR mode) 		Both of the locical parameters are replaced by onecharacter parameter that accepts following values in a comma separated list.
  • Resize/NoResize - Default: NoResize
  • KeepRatio/NoKeepRatio- Default: NoKeepRatio
Default for "" is NoResize (implicit NoKeepRatio).
DefFreeLine
(INT x, INT y, INT x1, INT y1, INT style, INT Width, CHAR col) 		DefFreeLine
(INT x, INT y, INT x1, INT y1, CHAR style, INT Width, CHAR col) 		INT style parameter is replaced by a string "solid", "dash", "dot", "Dashdot", "Dashdotdot"
DefHLine
(INT x, INT y, INT len, INT Style, INT width, CHAR col) 		DefHLine
((INT x, INT y, INT len, CHAR Style, INT width, CHAR col) 		INT style parameter is replaced by a string "solid", "dash", "dot", "Dashdot", "Dashdotdot"
DefHSep
(INT len, INT justify, INT style, INT width, CHAR col) 		DefHSep
(INT len, CHAR justify, CHAR style, INT width, CHAR col) 		INT style parameter is replaced by a string "solid", "dash", "dot", "Dashdot", "Dashdotdot"
INT justify parameter is replaced by a CHAR:
"fill" - -1 before
"left"
"right"
"center"/"centered"
DefRect
(INT x, INT y, INT width, INT height, INT filled, CHAR col) 		DefRect
(INT x, INT y, INT width, INT height, CHAR filled, CHAR col) 		- INT filled is replaced by CHAR: "fill","filled","true" - fill; "","false", "unfilled", "nofill" - not fill
DefVLine
(INT x, INT y, INT len, INT Style, INT width, CHAR col) 		DefHLine
(INT x, INT y, INT len, CHAR Style, INT width, CHAR col) 		INT style parameter is replaced by a string "solid", "dash", "dot", "Dashdot", "Dashdotdot"
GetPrinterAttrib
(CHAR attrib, OUTPUT int value) 		FetchPrinterAttrib
(CHAR attrib, OUTPUT CHAR value),
CHARVAR = GetPrinterAttrib(CHAR attrib). 		OUTPUT is defined as CHAR (Get renamed to Fetch.) Same is true for the corresponding Get-function.
SetCellAlign
(CHAR CellName, CHAR GrpName, INT mode) 		SetCellAlign
( (CHAR CellName, CHAR GrpName, CHAR mode) 		- INT mode is replaced by CHAR: "left","right","block"/"justify","centered"
SetCellAutoResize
( (CHAR CellName, CHAR GrpName, LOGICAL mode) 		SetCellAutoResize
( (CHAR CellName, CHAR GrpName, CHAR mode) 		- LOG mode is replaced by CHAR, allowing usual LOG values and: "0","noresize", "1","resize"
SetCellRTF
(CHAR CellName, CHAR GrpName, CHAR Mode) 		- no change Mode supports on/off, but also rtf/nortf
SetCellSplit
(CHAR CellName, CHAR GrpName, CHAR Mode) 		- no change Mode supports on/off, but also split/nosplit
SetCellWrap
(CHAR CellName, CHAR GrpName, LOGICAL mode) 		SetCellWrap
(CHAR CellName, CHAR GrpName, CHAR mode) 		Mode supports on/off, but also "wrap/nowrap"
SetGroupCellPositioning
(CHAR GrpName, INT Mode) 		- removed Not really removed, but removed from the documentation, because there is no need for this command. *If you really want it, look into the vpb.i or in the old documentation.


Viper Printing Tool

Tools for Progress

Viper Printing Tool (3.3)

This documentation covers the Viper command language.

Viper Designer (3.3)

This documentation covers the Viper layout designer tool.

Viper Assistant (1.0)

This documentation covers the Viper deployment assistant.

© IAP GmbH 2002-2015


Viper installation

Installation of VIPER version 97-07-07

Caution! We no longer (actually, since Version 1.1 or so) deliver r-code (to avoid problems with the progress versions). So you must delete old r-files. Otherwise Progress would use them and would not be able to find the new procedures.

The examples are using the sports.db, so you have to copy the sports.db into your VIPER directory.
The entry for calling the main test program should look like:
16 Bit (to 8.1x): _prowin.exe sports -1 -p runme.w
32Bit (from 8.2x): _prowin.exe sports -1 -p runme32.w

The version runme32.w was nescessary to make a good looking screen. The default fonts of PROGRESS are changed in 8.2 and we use the standard fonts.

© 1997 - 1999 IAP GmbH, Mörkenstr. 9, 22767 Hamburg, +49-40-389796, viper.iap.de


QUERY FUNCTIONS

vpr_FetchPageVSpace | Gives an account of free space on page
vpr_FetchPageNo | Gives the number of pages in document
vpr_FetchPageVPos | Obtains current cursor position
vpr_FetchGroupVPos | Retrieves the vertical position of a group
vpr_FetchGroupHeight | Gives the group height
vpr_FetchCellHeight | Obtains the cell height
vpr_FetchCellWidth | Obtains the cell width
vpr_FetchCellHPos | Retrieves the horizontal position of a cell
vpr_FetchCellVPos | Obtains the vertical position of a cell
vpr_FetchCellHeight | Obtains the cell height
vpr_FetchCellLineCount | Retrieves number of remaining lines in the cell
vpr_ReadErrors | Reads errors
vpr_FetchPrinterAttrib | Obtain some printer attributes, by now only paperheight und -width.


vpr_ReadErrors

vpr_ReadErrors (INPUT-OUTPUT INT last, OUTPUT number)

Gives the last error (see Error Messages) in last and the total count of all errors in number.

Call:
RUN vpr_ReadErrors (INPUT-OUTPUT lastError, OUTPUT ErrorCount).


Table of Contents

This documentation covers the Viper command language. For documentation on the Viper Frame Designer click here.

  1. Introduction
  2. Basic Viper
  3. The Viper-API
  4. Viper Setup and Utilities
  5. Error Handling
  6. The Preview's User Interface
  7. What's new
  8. What's next
  9. Known Bugs and Weaknesses
  10. How to purchase Viper
  11. Release history


VIPER Frame Designer

LoadReport | (CHAR ReportName)

This procedure loads a report into memory. This report must be in the library which is set with the "SetParam" command.
The ReportName is the name of the report which should be loaded.

example:
RUN LoadReport IN h-vreport ("Invoice 1").


VIPER Designer

vpr_LoadReportNum | (CHAR ReportNum)

This procedure activates one of the loaded reports. It sets the report with number ReportNum as current report.
This report must be loaded into Viper with one of the "vpr_LoadXXX" commands first.

example:
 RUN vpr_LoadReportNum (3).


VIPER Designer - V 1.0

What's next in VIPER Designer

Planned

Multi language support

Support more then one language. The values will be stored in a text file an could be customized. As first language I will add "german" ;-))

Copy function

Add a copy function to copy cells from one report to annother or inside a report.


VIPER Designer

vpr_RemoveReportNum | (CHAR ReportNum)

This procedure removes loaded reports from memory . It removes the report with number ReportNum from Viper access.
This report must be loaded into Viper with one of the "vpr_LoadXXX" commands first.

example:
 RUN vpr_RemoveReportNum (42).


VIPER Frame Designer

VIPER Frame Designer - V1.01

Table of Contents

  1. What is the Viper Frame Designer
  2. Installation
  3. Framer API or how to launch a defined report
  4. Invoice and itemlist - samples
  5. Frame Designer API
  6. Font and color handling
  7. Which versions of Progress are supported?
  8. HowTo
  9. About

Also take a look at the documentation of Viper or to "Whats's new to check out what has changed in the actual version.


What's next?

This section describes the planned changes and features for the following release(s).

Porting

  • Viper 4.0 will add support for Linux and some Unix environments

New Features

  • An object oriented API


XSL-FO Info

Some information about XSL-FO

Since version 3.1 Viper can export reports as XSL-FO documents. What does that mean?

XSL-FO stands for eXtensible Stylesheet Language - Formatting Objects. It is an integral part of the W3C "XSL" recommendation (and that means: a web standard). It is an XML dialect that is suitable for representing (textual) data and the necessary formatting information in one XML file.

In the process of creating a formatted document from an XML source, that the W3C is envisioning in its recommendation it is the format that is created from a XML source by using a XSL-Transformation. The resulting XSL-FO is then processed by a XSL-FO renderer that can output the result in various formats, like PDF, RTF or HTML.

With Viper exporting XSL-FO, you can make use of the fact, that there are already a couple of XSL-FO rendering engines, that produce several output format. This should allow you to create documents in formats that may not even exist now. One drawback of this is, that the rendering engines can not be included in Viper and that the quality of the resulting document depends not only on the chosen format, but also on the quality of the rendering engine. With new engines popping up almost every week, we hope that the quality will raise and that the available conversion become more.

We tested our XSL-FO export with two renderers: FOP which is part of the Apache project (the worlds most famous web server) and with jfor. FOP produces several output formats, e.g. PDF, text or Java-AWT, jfor can produce RTF documents (though with Vipers' FO the results are far from perfect). Both are still under development.

Another free FO-renderers: PassiveTeX. There are also some commercial products available, for example: RenderX, XSL Formatter, Unicorn XML Toolkit. If you search the internet you will definitely find more.

More information about XSL-FO can be found at the W3Cs' XSL site, at ZVONs XSL FO reference, at http://www.dpawson.co.uk/xsl/sect3/index.html and at many more places all over the world and the internet.