The page range will be replaced with the generated report.
Output | XFRX version |
---|---|
10.1 | |
RTF | 16.1 |
FRTF | 16.1 |
Examples:
Parameter | Meaning |
---|---|
.T. | The generated report will be appended to the end of the existing document. |
1 | The generated report will be inserted at the beginning of the existing document. |
5 | The generated report will be inserted to the existing document, between pages 4 and 5. |
“R5” | The generated report will be inserted between pages 4 and 6, replacing page 5. |
“R4:8” | The generated report will be inserting between pages 3 and 9, replacing pages 4,5,6,7 and 8. |
.F. or 0 | The existing document will be overwritten. |
SetOtherParams(…)
This method is used to add various output type specific parameters. The first parameter is a string value representing the parameter to be set, the second parameter is the values to be set.
Example:
To set the next sheet name in the XLS document to “Customer 1”, call:
.SetOtherParams("NEXT_SHEET_NAME", "Customer 1")
HTML specific parameters
Name | Type | Note | XFRX version |
---|---|---|---|
PRINT_BOOKMARKS | Logical, Numeric | You can send two parameters with this option. The first parameter is logical and controls if the bookmark should be displayed (.T.) or not (.F. = default value).
The second parameter specifies what kind of bookmarks should be displayed:
| |
CONVERTEMF_TIFFTOPNG | Logical | Default value is .F. | XFRX 15.5 |
INLINEIMAGES | Logical | Default value is .F. If this parameter is set to .T., then images will be inside output file. | XFRX 16.0 |
Plain text specific parameters
Name | Type | Note |
---|---|---|
PLAIN_CPI_HORIZONTAL | Numeric | Horizontal characters per inch value |
PLAIN_CPI_VERTICAL | Numeric | Vertical characters per inch value |
PLAIN_SHOW_LINES | Logical | Default value = .T. This parameter allows for suppressing horizontal lines from the generated file |
Please find more information about plain text parameter in Converting reports to plain text chapter on page 41.
XLS, XLSPLAIN, NATIVE_FXLS, NATIVE_PFXLSX, ODS,FODS, PFODS specific parameters
Name | Type | Note |
---|---|---|
DISPLAY_GRID_LINES | Logical | Default value = .T. If this parameter is set to .F., the grid lines in the XLS output will not be visible. |
LEAVE_FULL_FIELD_CONTENT | Logical | Default value = .F. By default, the content of non-stretchable fields is cut according to the size of the field. This option enables to leave the full content of the field in the Excel cell. |
NEXT_SHEET_NAME | String | The name of the next sheet to be inserted by next report run. |
NEXT_SHEET_NAME_EXPR | String | This expression, if defined, is evaluated at the bottom of each sheet and the result is used as the sheet name. This parameter takes precedence over the NEXT_SHEET_NAME parameter. |
ADDPAGENUMBERTOSHEETDISPLAYNAME | Logical | Default value = .T. If this parameter set to .F. then XFRX suppresses sheet number in sheet name. |
SHEET_PER_PAGE | Logical | Default value = .F. By default, the XLS document is generated in “Plain” mode – one long sheet is generated, with the page header at the top and the footer at the bottom. If this parameter is set to .T., then each report page is generated as a new sheet. |
SHEET_PER_NP_GROUP | Logical | Default value = .F. This option combines the plain mode and the sheet-per-page mode. If this parameter is set to .T. (and SHEET_PER_PAGE is .F.), then a new sheet is generated for each report group with “Start each group on a new page” flag set to .T. |
SHEETPAGEBREAK | Logical | Default value = .F. This option add page breaks in sheet by report pages.(Since XFRX 15.7) |
HORIZONTAL_ADJUSTMENT VERTICAL_ADJUSTMENT | Numeric | The maximal coordinates difference considered as zero. Please see XLS cells adjustment chapter on page 37 for more information. |
Finalize()
This method finishes the document generation and displays the generated document (unless the document preview was explicitly suppressed).
The Finalize() method does not have to be called in VFP 9.0, if the last REPORT FORM command doesn’t contain the NOPAGEEJECT clause.
initLog()
This method create log file with name "_XFRX.log".
Syntax
Code Block |
---|
= loXFRXobj.initLog(<tlSilent>) |
Parameters:
tlSilent
do not write header to log file [optional]
setLogFile()
This method create log file with name <tcLogFile>.
Syntax
Code Block |
---|
= loXFRXobj.setLogFile(<tcLogFile>, <tlSilent>) |
Parameters:
tcLogFile
the name of the log file to create.
tlSilent
do not write header to log file [optional]
Methods for registering page bound XFF scripts
RegisterScript()
Syntax:
Code Block |
---|
RegisterScript(toScriptObject, tcScriptMethod, tnZOrder, tcPageScope, tnNumberingType) |
Parameters:
toScriptObject
The PDFLScripts object reference
tcMethodName
The name of the method containing the script
tnZIndex
0 ... print below (before) the report page
1 ... print above (after) the report page
tcScope
Defines which pages to invoke the scripts on. Can contain "ALL", "ODD", "EVEN" and numbers delimited with commas. Hyphens can be used to define the from-to scope. Examples: "ODD", "1,5-19", "ODD,4,8"
tnPageNumberingType
Defines how XFRX determines the page number:
0 ... absolute - the page number in the document,
1 ... relative - the page number in the current report,
2 ... the value of _PAGENO
UnregisterAllScripts ()
Syntax:
Code Block |
---|
UnregisterAllScripts() |
If multiple reports are merged together and you would like to apply scripts on a certain report but not on subsequent ones, call this method to remove all scripts registrations.
This method does not need to be called at the end of the reports processing.
Page size adjustment methods
setPaperSize()
Use this method to define a user-define page size.
Syntax:
Code Block |
---|
setPaperSize(nUDPaperWidth, nUDPaperHeight[,nUDPaperOrientation] ) |
Please see User-defined page size paragraph on page 18 (nad) for more information.
nUDPaperWidth
Paper width
nUDPaperHeight
Paper height
nUDPaperOrientation
Paper orientation (XFRX 15.5)
ShrinkHeight()
Use this method to shorten the page size. Please see HTML page size adjustment na stránce 34 for more information.
Methods to define document encryption
setPasswords()
Sets passwords for PDF and Word document protection.
PDF syntax:
Code Block |
---|
setPasswords(tcOwnerPassword, tcUserPassword) |
Parameters:
The user password (tcUserPassword) can be empty. If the owner password (tcOwnerPassword) is empty, a random string will be generated as the password.
The owner can do anything with the document. The user permissions can be set using the setPermissions() methods.
Word syntax:
Code Block |
---|
setPasswords(tcReadPassword, tcWritePassword, tlRequirePassword) |
You can omit either tcReadPassword or tcWritePassword. tlRequirePassword is optional (default value is .F.). If set to .T., Word will ask for the password even when the document is being opened first time after the generation (if DoNotOpenViewer property is set to .F.).
setPermissions()
Sets the user permissions in the PDF document.
Syntax:
Code Block |
---|
setPermissions(tlPrintDocument, tlModifyDocument, tlCopyTextAndGraphics, tlAddOrModifyAnnotations) |
Methods to set document properties
setAuthor()
Sets the document author property.
Syntax:
Code Block |
---|
setAuthor(tcvalue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setCategory()
Sets the document “Category” property.
Syntax:
Code Block |
---|
setCategory(tcvalue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setComments()
Sets the document “Comments” property.
Syntax:
Code Block |
---|
setComments(tcvalue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setCompany()
Sets the document “Company” property.
Syntax:
Code Block |
---|
setCompany(tcValue) |
setCreator()
Sets the document “creator” property.
Syntax:
Code Block |
---|
setCreator( tcValue ) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setKeywords()
Sets the document “keywords” property.
Syntax:
Code Block |
---|
setKeywords(tcValue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setManager()
Sets the document “Manager” property.
Syntax:
Code Block |
---|
setManager(tcValue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setProducer()
Sets the document “producer” property.
Syntax:
Code Block |
---|
setProducer(tcValue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setSubject()
Sets the document “Subject” property
Syntax:
Code Block |
---|
setSubject(tcValue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setTitle()
Sets the document title property.
Syntax:
Code Block |
---|
setTitle(tcValue) |
Parameters: tcValue (char) is a value that will be used in the document properties.
setCreationDate()
Sets the document creation date property (since XFRX 16.0).
Syntax:
Code Block |
---|
setCreationDate(tdValue) |
Main methods
ErrorMessage()
Syntax:
Code Block | ||
---|---|---|
| ||
lnRetVal = loXFRXobj.ErrorMessage(lnErrorNo) |
This method returns a error message corresponding to the value returned from SetParams() method.
Setparams()
Call this method to set the document generation parameters.
Syntax:
Code Block | ||
---|---|---|
| ||
lnRetVal = loXFRXobj.SetParams(<tcOutputName>, <tcTempDirectory>, <tlNotOpenViewer>, <tcCodePage>,
<tlSilent>, <tlNewSession>, <tcTarget>, <tcArchive>, <tlAdditive>,
<tlDeleteFileAfter>, <tuAppend>) |
Return values:
0 ... everything was ok, you can start processing reports
-1 ... cannot load Word or Excel application
-2 ... the Word or Excel application version must be 2000 or higher
-3 ... cannot create or open the output file
-4 ... unknown target
-5 ... hndlib.dll cannot be loaded (it is missing or an old version is used)
-6 ... xfrxlib.fll cannot be loaded (it is missing or invalid). Please see Frequently asked questions if you are getting this error.
-7 ... zlib.dll cannot be loaded
-8 … An old xfrxlib.fll is used
-9... Sorry, Word 2007 or higher is required for docx format!
-10 … The existing document is either corrupted or in an unsupported format
-11 ... Signature file not found
-12 ... Cannot use the signature file
-13 ... The output folder does not exist or you do not have write access
-14 ... The existing document use xref stream - it's no possibly append data. (since XFRX 16.1)
Info |
---|
You can retrieve the English message for the code returned with ErrorMessage() method. |
Parameters:
tcOutputName
the name of the document to create.
tcTempDirectory
directory where temporary files will be created. If blank, the temporary files will be created in Visual FoxPro Temporary Path [optional]
tlNotOpenViewer
if set to .T., documents won't be opened after the generation [optional]
tcCodePage
is a codepage of the generated document [optional]. If you don't specify this parameter, cpcurrent() is used.
tlSilent
if set to .T., no messages will be printed [optional]. This option is useful if your application is not in English and/or you would like to handle the Processing... message and error messages in your code.
tlNewSession
by default, word document will be open in the current Word session, if exists. If this paramenter is set to .T., the document will always be open in a new Word session. This option is not used for PDF targets. [optional]
tcTarget
The output type to be generated. One of the values listed at XFRX Output Target Types (above).
tcArchive
The name of the zip archive to be created. If not empty, the generated file will be added to the archive after generation (optional)
tlAdditive
If set to .T. and the archive already exists, the file will be added. (optional)
Please note: you can add several files to the archive, but existing files with the same name will not be overwritten - the new files will always be added.
tlDeleteFileAfter
If set to .T., the generated file is be deleted after it is copied to the archive. (optional)
tuAppend
Specifies whether the generated document will be appended to an existing file. This parameter can be either logical, numeric or a string, with the following meaning:
Type
Value
Meaning
Logical
.F.
An existing document will be overwritten
Output | XFRX version |
---|---|
10.1 | |
RTF | 16.1 |
FRTF | 16.1 |
PLAIN | 16.1 |
.T.
The generated report will be appended at the end of the existing document
Output | XFRX version |
---|---|
10.1 | |
RTF | 16.1 |
FRTF | 16.1 |
PLAIN | 16.1 |
Numeric
0
An existing document will be overwritten
Output | XFRX version |
---|---|
10.1 | |
RTF | 16.1 |
FRTF | 16.1 |
PLAIN | 16.1 |
<page No.>
The generated report will be inserted to the existing document at the given page number.
Output | XFRX version | |
---|---|---|
10.1 | ||
RTF | 16.1 | |
FRTF | 16.1 | |
PLAIN | 17.0 | Only for value 1. |
String
“R<page No.>”
The page will be replaced with the generated report.
Output | XFRX version |
---|---|
10.1 | |
RTF | 16.1 |
FRTF | 16.1 |
“R<from>:<to>”