Properties and methods common in XFRXListener and XFRXSession classes
Properties
PictureDPI | DPI (dots-per-inch) resolution to which all pictures are recomputed. You can use this property to reduce the output document size. This property must be sent before calling the SetParams method. | |
---|---|---|
DefaultPictureFormat | Picture format of activeX components converted to pictures. Allowed values: “bmp”, “jpg”, "png", "tif", "gif" Default value: “jpg” | |
JPEGQuality | JPEG Quality for converting to JPEG format. Default value: 80 | XFRX 15.1.0 |
lOldMultiLineBehavior | Turn on old algorithm for calcs height of multi line text | XFRX 15.0.3 |
nFlowLayoutMode | Mode for flow layout outputs: FDOC, FRTF, FODT, NATIVE_FDOCX 1 - header,detail,footer are generates as page header, detail and page footer (default value) 2 - header,detail,footer are generates as detail | XFRX 15.5.0 |
Main methods
ErrorMessage()
|
Syntax: lnRetVal = loXFRXobj.ErrorMessage(lnErrorNo)
This method returns a error message corresponding to the value returned from SetParams() method.
| ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Call this method to set the document generation parameters. Syntax:
Return values: 0 ... everything was ok, you can start processing reports
Parameters: tcOutputName tcTempDirectory tlNotOpenViewer tcCodePage tlSilent tlNewSession tcTarget tcArchive tlAdditive 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 tuAppend
Examples:
This parameter applies to PDF documents only (optional, default value = .F.) | ||||||||||||||||||||||||||||||||||||||||||||||||
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
Plain text specific parameters
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
| ||||||||||||||||||||||||||||||||||||||||||||||||
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
Parameters: tlSilent
| ||||||||||||||||||||||||||||||||||||||||||||||||
setLogFile() | This method create log file with name <tcLogFile>. Syntax
Parameters: tcLogFile tlSilent |
Methods for registering page bound XFF scripts
RegisterScript() | Syntax:
Parameters: toScriptObject tcMethodName tnZIndex tcScope tnPageNumberingType | ||
---|---|---|---|
Unregister AllScripts () | Syntax:
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:
Please see User-defined page size paragraph on page 18 (nad) for more information. nUDPaperWidth nUDPaperHeight nUDPaperOrientation
| ||
---|---|---|---|
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:
Parameters: The user password (tcUserPassword) can be empty. If the owner password (tcOwnerPassword) is empty, a random string will be generated as the password. Word syntax:
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:
|
Methods to set document properties
setAuthor() | Sets the document author property. Syntax:
Parameters: Info | | |||
---|---|---|---|---|---|
setCategory() | Sets the document “Category” property. Syntax:
Parameters:
| ||||
setComments() | Sets the document “Comments” property. Syntax:
Parameters:
| ||||
setCompany() | Sets the document “Company” property. Syntax:
Parameters:
Remarks: This value will be used for Word and Excel documents only. | ||||
setCreator() | Sets the document “creator” property. Syntax:
Parameters:
Remarks: This value will be used for PDF documents only. | setKeywords() | |||
setKeywords() | Sets the document “keywords” property. Syntax:
Parameters:
Remarks: This value will be used for PDF, Word and Excel documents. | ||||
setManager() | Sets the document “Manager” property. Syntax:
Parameters:
Remarks: This value will be used for Word and Excel documents only. | ||||
setProducer() | Sets the document “producer” property. Syntax:
Parameters:
Remarks: This value will be used for PDF documents only. | ||||
setSubject() | Sets the document “Subject” property Syntax:
Parameters:
Remarks: This value will be used for PDF, Word and Excel documents. | ||||
setTitle() | Sets the document title property. Syntax:
Parameters: | ||||
setCreationDate () | Sets the document creation date property (since XFRX 15.8). Syntax:
| Remarks: This value will be used for PDF, Word and Excel documentsParameters: tdValue (date/datetime) is a value that will be used in the document properties. |
XFRXListener class
Properties:
AppendToFile | 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:
Examples:
This property applies to PDF documents only. | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CodePage |
The code page of the output document.
| |||||||||||||||||||||||||||||||||||
DoNotOpenViewer |
If set to .T., documents won't be opened after the generation. Default value = .F.
| |||||||||||||||||||||||||||||||||||
NewViewerSession |
By default, Word and HTML documents will be open in the current instance of the application, if exists. If this parameter is set to .T., the document will always be open in a new Word / Web browser instance. Default value = .F.
| |||||||||||||||||||||||||||||||||||
QuietMode |
This is a property of the ReportListener class. If set to .T., no message will be printed during the report generation process.
| |||||||||||||||||||||||||||||||||||
targetFileName |
The name of the file to be generated.
| |||||||||||||||||||||||||||||||||||
targetType |
The output type to be generated. One of the values listed at XFRX Output Target Types (above).
|
Methods:
Info |
---|
The common methods are described at Properties and methods common in XFRXListener and XFRXSession classes (above). |
zipDocument() |
Specifies that the generated document should be added to a zip archive. Syntax:
Return values: none Parameters: ArchiveName (char) is the file name of the zip archive AddToArchive (logical) specifies, if the file should be added to existing archive (.T.) or if a new archive should be created (.F.) DeleteSourceDocument (logical) if set to .T., the source document will be deleted after adding to the archive.
|
---|
XFRXSession class
Info |
---|
The common methods are described at Properties and methods common in XFRXListener and XFRXSession classes (above). |
lMultiDetailBehavior | Turn on support multi details for XFRX#INIT (experimental functionality). | XFRX 15.1 | ||
---|---|---|---|---|
lHidePictureOutsideBand | .T. - Hide picture if bottom line is out of band (default value) .F. - Show picture if bottom line is out of band | XFRX 15.5 | ||
ProcessReport() |
Processes the report. Syntax:
Parameters: tcReportName tcForClause tlSummary tcScopeClause tcWhileClause tlPlain
|
XFRX#DRAW class
Properties:
PageCount | The total number of pages in the XFF document (numeric) |
---|
Methods:
AddPage() | Adds a new page at the end of the document.
Syntax:
Or
Parameters: tcPageSize tnPageWidth, tnPageHeight
If no page size is specified, the current page size is used.
| ||||
---|---|---|---|---|---|
CreateDocument()
|
Creates a new XFF file. Syntax:
Return values .T. … the file was successfully created
An existing file is overwritten. Parameters: tcFileName | ||||
DrawLine() |
Draws a line on the current page. Syntax:
Parameters: tnXPos, tnYPos tnXToPos, tnYToPos tnLineWidth tnPenPattern Optional, default value = 8. | ||||
DrawPicture() |
Draws a picture on the current page into a given bounding rectangle. Syntax:
Parameters: tnXPos, tnYPos tnWidth tnHeight tcFileName tnAdjType llCentralHorizontaly tnRotate tnRotationPoint The point within the rectangle around which the text is rotated. The allowed values are 0..8, optional, default value = 0 (left, top). Please see the picture on the right for the point positions (since XFRX 15.7). tcLinkName tcLinkRef | ||||
DrawRectangle()
|
Draws a rectangle on the current page. Syntax:
Parameters: tnXPos, tnYPos tnWidth tnHeight tnLineWidth tnFill tnPenPattern Optional, default value = 8. tnRoundFactor
| ||||
DrawText() | Draws a text, using a font defined by SetFont method. Syntax:
Or
Parameters: tnLeft, tnTop tcText tnRotate tcLinkName tcLinkRef tcBookmark tcTooltip tnMode liCP | ||||
DrawTextBox() |
Word wraps the give text and print it into a given bounding rectangle. If the height of the rectangle is zero, then the rectangle stretches to accommodate to full text and the height of the rectangle is returned. Syntax:
Return value: Parameters: tnLeft, tnTop tnWidth, tnHeight tnAlign 0 … “left” Optional, the default value is 0 (left). tnVAlign 0 … “top” Optional, the default value is 0 (top). tnRotate tnRotationPoint
The point within the rectangle around which the text is rotated. The allowed values are 0..8, optional, default value = 0 (left, top). Please see the picture on the right for the point positions. tcLinkName tcLinkRef tcBookmark tcTooltip tnMode liCP
| ||||
GetBounding |
Returns the bounding rectangle coordinates in the rectangle-bound script. Syntax:
Return value: NULL - the bounding rectangle is not available
The unit of the coordinates can be set by SetUnit() method. The default unit is Point (1/72 in).
| ||||
GetPageWidth()
|
| ||||
GetPageHeight()
|
| ||||
GetXPos()
|
Returns the horizontal coordinate of the current position. Syntax:
| ||||
GetYPos()
|
Returns the vertical coordinate of the current position. Syntax:
| ||||
OpenDocument()
|
Opens an existing XFF file. Syntax:
Return values .T. … the file was successfully opened
| ||||
PrintDocument() |
Prints the XFF file to the specified printer. Syntax:
Return values -100 … cannot initialize printer device
Parameters: tcPrinterName tcJobName tnFrom tnTo tcDEVMODE tnPagesPerSheet tnAllEvenOdd 1 ... all pages (default value) tnCopies tnUnderlineHyperlinksOnPrint
lcOutput (XFRX 15.5)
Alternatively, tnFrom can contain a string value, containing the pages numbers separated by commas and ranges separated by dashes, e.g.: “1,2,5-6,8,20-30”
| ||||
SavePicture() |
SavePicture method saves the report page(s) as a picture. Syntax: XFRXDraw::SavePicture(tcFilename, tcType, tnFrom [, tnTo [, tnBpp [, tnJPEGQuality [, tnThumbnailWidth [, tnThumbnailHeight [, tnPagesPerSheet, [ tnAllEvenOdd, [laFindString, [liBackgroundMode] ] ] ] ] ] ] ] ])
Return values
Parameters: tcFilename tcType tnFrom tnTo tnBpp tnJPEGQuality tnThumbnailWidth tnThumbnailHeight tnPagesPerSheet tnAllEvenOdd 1 ... all pages (default value) laFindString (XFRX 15.4) liBackGroundMode (XFRX 15.5) Background mode of output picture for TIFF,EMF and PNG format 0 ... Opaque (default color is white)
If both tnThumbnailWidth and tnThumbnailHeight are omitted, the original page size is used. If only one of the values is sent, the other one is calculated accordingly.
| ||||
SetColor() |
Sets the foreground and background drawing colors. Syntax:
Parameters: tfr, tfg, tfb tbr, tbg, tbb
| ||||
SetFont()
|
Sets font name and attributes for subsequent DrawText() or DrawTextBox() calls. Syntax:
Parameters: tcFontName tnSize tlBold, tlItalics, tlUnderline, tlStrikeThrough
| ||||
SetPos()
|
Sets the position where the text will be drawn by the subsequent DrawText() method call. Syntax:
Parameters: tnXPos, tnYPos
| ||||
SetUnit() |
Sets the drawing units. Syntax:
Parameters: tcUnit
|
XFCont class
XFRX Preview container class. This section describes properties that you can modify in your custom implementation of the previewer.
|
| ||
---|---|---|---|
|
| ||
|
| ||
|
Syntax:
Parameters: tcMessage |
eqZIP class
eqZIP class. This section describes methods for creates ZIP archive.
OpenArchive | Open ZIP archive file. Syntax:
Parameters: m.tcZipName The ZIP archive file.m.tnAppend A append flag.Return values .T. - Archive create/open successfully..F. - Archive do not create/open successfully. | ||||
---|---|---|---|---|---|
CloseArchive | Close ZIP archive file. Syntax:
Parameters: m.tcComment ZIP archive comment.
| ||||
OpenNewFile | Open file handle. Syntax:
Parameters: m.tcFileName File name in ZIP archive.m.ttCreated Datetime created.m.llIWontUTF8 A wish uses UTF-8 for encoding file name.
m.lcPassword File password.m.liCRC32 File CRC32 checksum. it is mandatory for m.lcPassword. Checksum is for all data.
Return values | ||||
AppendFile | Add some file to ZIP archive. Syntax:
Parameters: m.tcFileName The source file name.m.tcNameInArchive File name in ZIP archive.m.llIWontUTF8
m.lcPassword File password.Return values | ||||
WriteData | Write data to opened file handle. Syntax:
Parameters: m.tcData Return values | ||||
CloseFile | Close file handle. Syntax:
| ||||
SYS2007 | Calculate CRC32 checksum for data. Syntax:
Parameters: m.lcData
|