Preprocesssed [@] Page bookmarks and Xvalues

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Preprocesssed [@] Page bookmarks and Xvalues

Page bookmarks and XValues are special tags delimited by brackets "[" and "]"

 

Syntax:

DEFINITION


[@name]

sets a page bookmark in the report.

The page bookmark takes the value of the page number where the tag is defined, it's an integer value.

 

[@XValueName=value]

defines a Xvalue available in the report.

The value can be numeric (integer or decimal) or alphanumeric.

If a confusion may exist or if you want to keep the format, enclose the value within single or double quotes. Ex: [@Amount="1250.00"]

 

[@XValueName=TRANSLATE,target_lang [,source_lang] (text_to_translate) ]                         version 10.41

defines a translated "Xvalue" available in the report.

Full description of the tag in the translate function

 


USING

[=@name]

replaces this tag by the pre-processed value.

 


 

Notes:

Since the 10.41, a pre-processed variable "[@xxxx=xxxx]" may include other pre-processed variables. Only one level is allowed at this time.

Example:

[@TXT=Here is a text to be translated into several languages]

 

... then:

[@DE=translate,DE([@TXT])]

[@NL=translate,NL([@TXT])]

 

... which can also be written :

[@DE=translate,DE([=@TXT])]

[@NL=translate,NL([=@TXT])]

 

... are allowed.

Rules:

1.The pre-processed values are available anywhere in the report, BEFORE or AFTER they are defined.

2.If a same tag is defined multiple times, the last value is kept,

3.Use "\[@" and "\[=" to escape and print "[@" and "[="

 

Working with preprocessed values:

Such values can be used as strings or tag keywords within the report.

General usage:

Table of contents,

Expressions "Page n of m",

Keyword values like "<VIEWPAGE=[=@important]>, assumed that a page bookmark "[@important]" is set somewhere in the report,

Any kind of strings,

...

 

Basic syntax:

                 [=@name]                is replaced by the value of the bookmark page number or the xValue.

 

Advanced:

[=@name | num-value [ + | - ]   [ @name2 | num-value ] [ + | - ]  [ @name3 | num-value ] ......]

 

Examples:

1."Page 1 / n" in a report containing more than one section, like an invoices stream (arithmetic operations only apply to numeric values):
                       [=@endPage123-@startPage123+1]

a.Set a bookmark in the first page of the invoice 123 (example). [@startInvoice123]

b.Put a page bookmark in the invoice total page [@endInvoice123],

c.Then use page footer or header with
               "Page " myPageNumber " /        [=@endInvoice123-@startInvoice123+1]"

2.Table of summary:
                       <SENSITIVE,TYPE=LINK,ACTION=PAGE#[=@customer],DEFAULT=Customer,HINT=Customer>

3.Displaying the order total in the first page:

a.In the first page:                        Order total [=@TotalOrder]

b.in the last page:                        [@TotalOrder="1,234.56€"]

4.Calculations:

a.[@TotalOrder=1234.56]

b.[@VAT=56]

c.[=@TotalOrder+@VAT+25.73]

 

How it works?

From a technical point of view, vpxPrint evaluates all the page bookmarks or Xvalues "[@....]" in a first pass, before processing the file content.

That means that you may use and/or embed the page bookmarks in any vpxPrint syntax, string or keyword.

 

Have a look to xDict.w program file.

A Table of contents with sensitive buttons and areas is in the first page. Clicking of a button changes the current page to the one containing the page bookmark.

 

 

Tuto_Preprocessed2

Example of subtotals and preprocessed pages number from The Designer