Text format
- martinajindrova
- Martin Haluza
Supported formats
Change behavior in XFRX 24.0 - XFRX Listener creates report copy.
Currently, two formats are supported: pseudo HTML and BB code. RTF supports is in development.
Supported formats | ||||
---|---|---|---|---|
Name | Keyword | Description | XFRX version | Examples |
pseudo HTML | <TF> | Compatible with <TF> from FoxyPreviewer | 17.1 | TF-UNI.pdf, tf-uni_flow.rtf, TF-UNI.png, TF-UNI-09.pdf, TF-UNI-11.pdf, TF-UNI-28.pdf |
BB code | <BB> | See to http://www.bbcode.org/reference.php | 17.1 | BB-UNI.pdf, bb-uni_flow.rtf, BB-UNI.png |
RTF | <RTF> | See to https://www.microsoft.com/en-us/download/details.aspx?id=10725 | 17.2.0 | |
MarkDown | <MARKDOWN> | 19.0 |
Default settings - general
Parametr name | Description | Value | XFRX version |
---|---|---|---|
TF_DEFAULTTABSIZE | Default tabelator size. | "1in" | |
TF_LINE_HEIGHT | Default line height. | "20pt" | 17.1.1 |
TF_PREPROCESSING_ALLOWED | Flag of preprocessing. If .t., then XFRX try find _PAGETOTAL in textformat source. Works with XFRX#INIT only. Default value .F. | .T. | 18.2.0 |
Default settings - quote
Parametr name | Description | Value | XFRX version |
---|---|---|---|
TF_QUOTE_MARGIN | Margin for quote. | "10px" | |
TF_QUOTE_BACKCOLOR | Background color for quote. | "RGB(192,192,192)" "RGBA(192,192,192, 0.5)" | |
TF_QUOTE_POSTFIX | Author's postfix for quote. | " wrote: " | |
TF_QUOTE_VBORDERWIDTH | Width of vertical line | "4px" | 18.3 |
TF_QUOTE_VBORDERCOLOR | Color of vertical line | "RGB(0,0,0)" | 18.3 |
Default settings - code
Parametr name | Description | Value | XFRX version |
---|---|---|---|
TF_CODE_FONTNAME | Font name. | "Courier New" | 18.3 |
TF_CODE_FONTSIZE | Font size. | "10pt" | 18.3 |
TF_CODE_MARGIN | Margin for code. | "10px" | 18.3 |
TF_CODE_BACKCOLOR | Background color for code. | "RGB(218,218,218)" | 18.3 |
Default settings - list
Parametr name | Description | Value | XFRX version |
---|---|---|---|
TF_LIST_MARGIN | Margin for list. | "10px" | |
TF_LIST_TABSIZE | Default tabelator for list. | "15px" | |
TF_LIST_BACKCOLOR | List back color | "RGB(192,192,192)" "RGBA(192,192,192, 0.5)" | 18.3 |
TF_LIST_BORDERWIDTH | Border width | "0px" | 18.3 |
TF_LIST_BORDERCOLOR | Border color | "RGB(0,0,0)" "RGBA(0,0,0, 0.5)" | 18.3 |
TF_LIST_ITEM_CHAR | Char for unordered list. | CHR(168) | |
TF_LIST_ITEM_FONTNAME | Font name for unordered list. | "Symbol" | |
TF_LIST_ITEM_OL_FORMAT | Order item format. | "lower roman" |
Default settings - Table
Parametr name | Description | Value |
---|---|---|
TF_TABLE_MARGIN | Margin for table. | "10px" |
TF_TABLE_PADDING | Cell padding. | "2px" |
TF_TABLE_BORDERSTYLE | Border style. | "solid" |
TF_TABLE_BORDERCOLOR | Border color. | "RGB(0,0,0)" |
TF_TABLE_BORDERWIDTH | Table border width. | "1px" |
TF_TABLE_BACKGROUNDCOLOR | Table background color. | "RGB(192,192,192)" "RGBA(192,192,192, 0.5)" |
TF_TABLE_THBACKGROUNDCOLOR | Table head bacgroud color | "rgb(255,255,192)" "rgba(255,255,192, 0.5)" |
TF_TABLE_ALIGN | Table/column align. | "left" |
TF_TABLE_TRBACKGROUNDCOLOR_EVEN | Even row background color. | "RGB(0,255,255)" "RGBA(0,255,255, 0.5)" |
TF_TABLE_TRBACKGROUNDCOLOR_ODD | Odd row background color. | "RGB(128,255,191)" "RGBA(128,255,191, 0.5)" |
m.loSession.setOtherParams( "TF_DEFAULTTABSIZE", "1in") m.loSession.setOtherParams( "TF_QUOTE_MARGIN", "10px") m.loSession.setOtherParams( "TF_QUOTE_BACKCOLOR", "RGB(192,192,192)") m.loSession.setOtherParams( "TF_QUOTE_POSTFIX", " wrote: ") m.loSession.setOtherParams( "TF_LIST_MARGIN", "10px",0) && default value for all levels m.loSession.setOtherParams( "TF_LIST_MARGIN", "10px",3) && value for third level m.loSession.setOtherParams( "TF_LIST_TABSIZE", "15px") m.loSession.setOtherParams( "TF_LIST_ITEM_CHAR", "CHR(168)") m.loSession.setOtherParams( "TF_LIST_ITEM_FONTNAME", "1in") m.loSession.setOtherParams( "TF_LIST_ITEM_OL_FORMAT", "lower roman") && se to list-style-type CSS attribute m.loSession.setOtherParams( "TF_TABLE_MARGIN", "2px") && default value for all levels m.loSession.setOtherParams( "TF_TABLE_PADDING", "3px") m.loSession.setOtherParams( "TF_TABLE_BORDERSTYLE", "solid") m.loSession.setOtherParams( "TF_TABLE_BORDERCOLOR", "rgb(0,0,0)") m.loSession.setOtherParams( "TF_TABLE_BORDERWIDTH", "1px") m.loSession.setOtherParams( "TF_TABLE_BACKGROUNDCOLOR", "rgb(205,205,205)") m.loSession.setOtherParams( "TF_TABLE_BACKGROUNDCOLOR", "rgb(205,205,205)",0,3) && default value for all levels and third column m.loSession.setOtherParams( "TF_TABLE_THBACKGROUNDCOLOR", "rgb(255,255,192)") m.loSession.setOtherParams( "TF_TABLE_ALIGN", "left") && default value for all levels m.loSession.setOtherParams( "TF_TABLE_ALIGN", "right",0,3) && default value for all levels and third column m.loSession.setOtherParams( "TF_TABLE_TRBACKGROUNDCOLOR_EVEN", "RGB(0,255,255)") && default value for all levels m.loSession.setOtherParams( "TF_TABLE_TRBACKGROUNDCOLOR_ODD", "RGB(128,255,191)") && default value for all levels m.loSession.setOtherParams( "TF_TABLE_PADDING", "3px",2) && default value for second level m.loSession.setOtherParams( "TF_TABLE_BACKGROUNDCOLOR", "rgb(215,215,215)",0) && default value for second level
How to use textformat with XFRX#LISTENER
VFP 9.0 SP0/SP1
In VFP 9.0 or VFP 9.0 with SP1, "Stretch with overflow" is not supported. Rich text can be rendered to textboxes with a static height only.
VFP 9.0 SP2
In VFP 9.0 with SP2, the rich text can be rendered to textbox with dynamic height or static height. For textbox with dynamic height to work correctly, CallEvaluateContents property must be set to 2:
loSession=EVALUATE([XFRX("XFRX#LISTENER")]) loSession.CallEvaluateContents=2
Textformat to screen
Output from textformat can be draw to the screen, too. You can download package Textformat2Screen.zip with examples for <tf> and <bb>.
DO tf2screen.prg WITH "<TF>","tf-001.txt" DO tf2screen.prg WITH "<BB>","bb-001.txt" * <tf> template examples USE "_data\tf" IN 0 USE "_data\tf-child" IN 0 ORDER "I01" ALIAS tf_child SELECT tf SET RELATION TO XX010 INTO "tf_child" DO "tf2screen.prg" with "<TF>","TF-009.txt" && TR template USE "_data\tf" IN 0 USE "_data\tf-child" IN 0 ORDER "I01" ALIAS tf_child SELECT tf SET RELATION TO XX010 INTO "tf_child" SKIP 1 DO "tf2screen.prg" with "<TF>","TF-010.txt" && LI template USE "_data\tf" IN 0 USE "_data\tf-child" IN 0 ORDER "I01" ALIAS tf_child SELECT tf SET RELATION TO XX010 INTO "tf_child" SKIP 2 DO "tf2screen.prg" with "<TF>","TF-011.txt" && P template * <bb> template examples USE "_data\bb" IN 0 USE "_data\bb-child" IN 0 ORDER "I01" ALIAS bb_child SELECT bb SET RELATION TO XX010 INTO "bb_child" DO "tf2screen.prg" with "<BB>","BB-003.txt" && TR template USE "_data\bb" IN 0 USE "_data\bb-child" IN 0 ORDER "I01" ALIAS bb_child SELECT bb SET RELATION TO XX010 INTO "bb_child" SKIP 1 DO "tf2screen.prg" with "<BB>","BB-004.txt" && LI template USE "_data\bb" IN 0 USE "_data\bb-child" IN 0 ORDER "I01" ALIAS bb_child SELECT bb SET RELATION TO XX010 INTO "bb_child" SKIP 1 DO "tf2screen.prg" with "<BB>","BB-005.txt" && LEFT template