Interactive features


The generated documents can include hyperlinks for faster navigation, PDF documents can also include bookmarks. The hyperlinks and bookmarks are controlled via Comment field of labels and fields.

In the beta version of VFP 9 there is a bug that makes it impossible to store anything into fields’ comment. Because XFRX uses the comment field to define hyperlinks and bookmarks, the “User data” field is now used for this purpose. In the final version, XFRX for VFP 9 will work both with comment and user data field.

This paragraph applies both to VFP 9 and VFP 8.

The hyperlinks are controlled via Comment field of report labels or fields. 

To create a link, you need a source field (the underlined text you will navigate from) and a target field (the place where you get when you click on a hyperlink). 

Creating source fields

Enter the following text into the comment of the source field:

#UR A HREF=<destination name>

The destination name is an expression, which is evaluated at the time of report generation. You can navigate to other fields in the same document, or to any URL. The destination names of other fields in the same document has to be preceeded with #.

Examples:

#UR A HREF="#top"

Navigates to the beginning of the document. "top" is a reserved word. Do not name target fields are "top".

#UR A HREF="#custlist"

Navigates to the field whose destination name is "custlist".

#UR A HREF="#"+customer.id

Navigates to the field whose destination name is eval(customer.id)

#UR A HREF="http://www.eqeus.com"

Navigates to Eqeus.com homepage

Creating target fields

To add a destination name to a (target) field, add the following text into the comment:

#UR A NAME=<destination name>

Example:

#UR A NAME=customer.id

This field will be a target field for source fields with HREF="#"+customer.id

Bookmarks

This paragraph applies both to VFP 9 and VFP 8.

Bookmarks are currently supported in PDF, HTML documents and XFRX previewer.

Bookmarks (document outline) serves as a "visual table of contents" to display the document structure. Users use this to interactively navigate in the document. To add a report field into the document outline simply put the following into the field's comment:

#UR OUTLINE=<outline_name>
#UR OUTLINESTYLE=<outline style number> && 0 - normal, 1 - italic, 2 - bold, 3 - italic+bold
#UR OUTLINECOLOR=<RGB schema>           && XFRX 19.0
#UR OUTLINEPARENT=<outline_parent_name> && XFRX 19.0

 The outline_name is an expression, which is evaluated at the time of report generation and the result is used as the bookmark item. If users click the bookmark, they will navigate to the corresponding report field.

Example:

In a report with a list of invoices grouped by customers, bookmarks containing the list of customer can be created by adding

#UR OUTLINE=invoices.customerName
#UR OUTLINESTYLE=IIF(ATC("a",invoices.customerName)>0,1,0)+IIF(ATC("t",invoices.customerName)>0,2,0)
#UR OUTLINECOLOR=IIF(ATC("a",invoices.customerName)>0,RGB(255,0,0), RGB(0,0,0))
#UR OUTLINEPARENT="Invoice List"

into the comment of a customer name field (or any other field you want to navigate to, e.g. the first field on a page with the customer).


To enable bookmarks in the HTML output, call

m.loSession.SetOtherParams("PRINT_BOOKMARKS", .T.)
m.loSession.SetOtherParams("PRINT_BOOKMARKS", .T., 0) && Page and report bookmarks (hierarchy)
m.loSession.SetOtherParams("PRINT_BOOKMARKS", .T., 1) && Only bookmarks from report
m.loSession.SetOtherParams("PRINT_BOOKMARKS", .T., 2) && Only bookmarks to pages
m.loSession.SetOtherParams("PRINT_BOOKMARKS", .T., 3) && List page and report bookmarks

before calling ProcessReport().

With bookmarks enabled, XFRX will generate three HTML pages (three files): the main page defining the page frames, the bookmark page and the page with the report output.


XFRX 16.1

Methods SetOutline() and SetOutlineTypes() are deprecated since XFRX 16.1.
Member oDocument of XFRX Session object is deprecated too. You can use member oDocumentWriter.

XFRX 17.3

Member  oDocument of XFRX Session object is removed. Methods SetOutline() and SetOutlineTypes() are removed too.