Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

XFRX Output Target Types

XFRX currently supports the following target types:

Document type

targetType

value

PDF document

PDF

XPS document

XPS

Word document with absolute layout

DOC

Word document with flow layout

FDOC

RTF document with absolute layout

RTF

RTF document with flow layout

FRTF

OpenOffice Writer document with absolute layout

ODT

OpenOffice Writer document with flow layout

FODT

OpenOffice Calc spreadsheet with absolute layout

ODS

OpenOffice Calc spreadsheet with flow layout

FODS

Excel document

XLS

Plain text document

PLAIN

HTML document

HTML

HTML document with included graphics

MHT

XML document

XML

XFF document (internal binary document)

XFF

XFRX previewer

CNT

Table of Contents

Remarks:

  • “DOC” and “FDOC” output types require MS Word (ver. 2000 or higher) do be installed. “RTF” and “FRTF” do not require any third party product to be installed and can be opened in MS Word 97 and higher.
  • “FRTF” document can also be opened with certain limitations in Open Office (http://www.openoffice.org) and PC Suite (http://www.software602.com/products/pcs).
    Open Office does not support any graphics in RTF, so lines, rectangles and pictures will not be displayed.
    PC Suite does not correctly display lines and rectangles, pictures, however, are displayed correctly.
  • Remarks: “XLS” output type requires MS Excel (ver. 2000 or higher) to be installed
  • Stored “XML” and “XFF” documents can be loaded back and previewed or transformed to other output types

    Table of Contents

     

    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.
    Default value: 0 (do not recompute, keep pictures as they are)

    DefaultPictureFormat

    Picture format of activeX components converted to pictures.

    Allowed values: “bmp”, “jpg”

    Default value: “jpg”

     

    Main methods

     

    ErrorMessage()

     

     

    Syntax:

    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
    collapsetrue
     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

    -10 … The existing document is either corrupted or in an unsupported format

     

    Info

    You can retrieve an English message for the code returned with ErrirMessage() 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 the current directory [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

     

    .T.

    The generated report will be appended at the end of the existing document

    Numeric

    0

    An existing document will be overwritten

     

    <page No.>

    The generated report will be inserted to the existing document at the given page number.

    String

    “R<page No.>”

    The page will be replaced with the generated report.

     

    “R<from>:<to>”

    The page range will be replaced with the generated report.

     

    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.

     

    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

    Name

    Type

    Note

    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:

    • Sending 0 will show both page number bookmarks and the ones defined in the report (default)
    • Sending 1 will show only the bookmarks defined in the report
    • Sending 2 will show only the page number bookmarks

     

     

    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 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.

     

    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.

     

    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. 

     

    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

     

    Unregister AllScripts ()

    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)

    Please see User-defined page size paragraph on page 18 (nad) for more information.

     

    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
    set(tcvalue)

     

    Parameters: 

    tcValue (char) is a value that will be used in the document properties.

     

    Info

    This value will be used for PDF, Word and Excel documents.

    setCategory()

    Sets the document “Category” property.

    Syntax:

    Code Block
    set(tcvalue)

    Parameters:

      tcValue (char) is a value that will be used in the document properties.

     

    Info

    This value will be used for Word and Excel documents only.

    setComments()

    Sets the document “Comments” property.

    Syntax:

    Code Block
    set(tcvalue)

    Parameters:

    tcValue (char) is a value that will be used in the document properties.

     

    Info

    This value will be used for Word and Excel documents only.

    setCompany()

    Sets the document “Company” property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for Word and Excel documents only.

     

    setCreator()

    Sets the document “creator” property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for PDF documents only.

     

    setKeywords()

    Sets the document “keywords” property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for PDF, Word and Excel documents.

     

    setManager()

    Sets the document “Manager” property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for Word and Excel documents only.

     

    setProducer()

    Sets the document “producer” property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for PDF documents only.

    setSubject()

    Sets the document “Subject” property

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for PDF, Word and Excel documents.

    setTitle()

    Sets the document title property.

     

    Syntax: set(tcvalue)

     

    Parameters:

     

    tcValue (char) is a value that will be used in the document properties.

     

    Remarks: This value will be used for PDF, Word and Excel documents.

    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:

    Type

    Value

    Meaning

    Logical

    .F.

    An existing document will be overwritten

     

    .T.

    The generated report will be appended at the end of the existing document

    Numeric

    0

    An existing document will be overwritten

     

    <page No.>

    The generated report will be inserted to the existing document at the given page number.

    String

    “R<page No.>”

    The page will be replaced with the generated report.

     

    “R<from>:<to>”

    The page range will be replaced with the generated report.

     

    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.

    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:

    Code Block
    zipDocument(ArchiveName, AddToArchive, DeleteSourceDocument)

    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.

     

    Info

    You can send these three parameters to XFRX either via this method or as the last three parameters of the SetParams method. This method is available for your convenience of you prefer to fill in XFRXListener properties and call SetParams without parameters.

    XFRXSession class

     

    Info

    The common methods are described at Properties and methods common in XFRXListener and XFRXSession classes (above).

     

    ProcessReport()

     

    Processes the report.

    Syntax:

    Code Block
    ProcessReport(<tcReportName>, <tcForClause>, <tlSummary>, <tcScopeClause>, <tcWhileClause>, <tlPlain>)

    Parameters: 

    tcReportName

      the name of the report file

    tcForClause

      the FOR clause [optional] 

    tlSummary

      The summary clause switch. If set to .T., the report is processed as if SUMMARY clause was used in the REPORT FORM command [optional] 

    tcScopeClause

      The string corresponding to the report's scope clause (such as NEXT 4, REST, ALL, RECORD nRecno). Default value is "ALL" [optional] 

    tcWhileClause

      The while clause [optional]

    tlPlain

    Plain format switch. Send .T.  as this parameter to switch the HTML output to PLAIN format. The plain format doesn't generate any page breaks to the document - one long page will be generated. The default value is .F.

     

    20.5 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:

    Code Block
    XFRXDraw::AddPage([tcPageSize])

    Or

    Code Block
    XFRXDraw::AddPage(tnPageWidth, tnPageHeight)

     

    Parameters: 

    tcPageSize

       The page size of the new page. Available values: “A4”, “letter”

    tnPageWidth, tnPageHeight

       The width and height of the new page. The unit can be defined by SetUnit() method. The default unit it point (1/72 in).

     

    If no page size is specified, the current page size is used.

     

     

    CreateDocument()

     

     

    Creates a new XFF file.

    Syntax:

    Code Block
    XFRXDraw::CreateDocument([tcFileName])

     

    Return values

    .T. … the file was successfully created

    .F. … file couldn’t have been created ()

     

    An existing file is overwritten.

     

    Parameters:

    tcFileName

       The file name if the document to be created. If this parameter is empty, the XFF file is created in memory.

     

    DrawLine()

     

    Draws a line on the current page.

    Syntax:

    Code Block
    XFRXDraw::DrawLine(tnXPos, tnYPos, tnXToPos, tnYToPos [, tnLineWidth[, tnPenPattern]])

    Parameters:

    tnXPos, tnYPos

       The X,Y coordinates of the start point of the line.

    tnXToPos, tnYToPos

       The X,Y coordinates of the end point of the line.

    tnLineWidth

       The line width in points. 0 represents hairline. Optional, default value = 1.

    tnPenPattern

       The border line pattern:

          0 ... no border

          1 ... dotted

          2 ... dashed

          3 ... dash-dot

          4 ... dash-dot-dot

          8 … solid line

       Optional, default value = 8.

     

    DrawPicture()

     

    Draws a picture on the current page into a given bounding rectangle. 

    Syntax:

    Code Block
    XFRXDraw::DrawPicture(tnXPos, tnYPos, tnWidth, tnHeight, tcFilename[, tnAdjType])

    Parameters:

    tnXPos, tnYPos

       The X,Y coordinates of the upper left hand corner of the bounding rectangle.

    tnWidth

       The width of the rectangle 

    tnHeight

       The height of the rectangle

    tcFileName

       The picture file name

    tnAdjType

       0  … clip picture

       1   … stretch picture, retain shape

       2   … stretch picture, fill frame

     

    DrawRectangle()

     

     

    Draws a rectangle on the current page.

    Syntax:

    Code Block
    XFRXDraw::DrawRectangle(tnXPos, tnYPos, tnWidth, tnHeight [, tnLineWidth[, tnFill[, tnPenPattern, tnRoundFactor]]])

    Parameters:

    tnXPos, tnYPos

       The X,Y coordinates of the upper left hand corner.

    tnWidth

       The width of the rectangle

    tnHeight

       The height of the rectangle

    tnLineWidth

       The line width in points. 0 represents hairline. Optional, default value = 1.

    tnFill

       0 ... not filled, 1 ... filled. Optional, default value = 0

    tnPenPattern

       The border line pattern:

          0 ... no border

          1 ... dotted

          2 ... dashed

          3 ... dash-dot

          4 ... dash-dot-dot

          8 … solid line

       Optional, default value = 8.

    tnRoundFactor

       The radius of the rectangle edges curvature. 0 makes the rectangle right-angled (no rounding), 99 creates an ellipse. Optional, default value = 0.

     

    Info

    The border and fill color needs to be defined via SetColor() method before calling DrawRectangle() method.

     

    DrawText

     

    Draws a text, using a font defined by SetFont method.

    Syntax:

    Code Block
    XFRXDraw::DrawText(tnLeft, tnTop, tcText[, tnRotate[, tcLinkName[, tcLinkRef[, tcBookmark[, tcTooltip]]]]])

    Or

    Code Block
    XFRXDraw::DrawText(tcText[, tnRotate[, tcLinkName[, tcLinkRef[, tcBookmark[, tcTooltip]]]]])

    Parameters:

    tnLeft, tnTop

       The coordinates where the text will be drawn. If the second syntax is used (without the coordinates), the text will be drawn at the current position: which is either a position defined by SetPos() method or a the end of an output if the previous DrawText() method call. 

    tcText

       The text to be drawn

    tnRotate

       The text rotation angle in degrees. The label will be rotated counterclockwise. Optional, default value = 0.

    tcLinkName

       If this parameter is filled, the text will be a named target of a hyperlink. (see tcLinkRef parameter).

    tcLinkRef

       If this parameter is filled, the text will be a hyperlink. It will navigate to a target in the local document with tcLinkRef name. To navigate to a http URL, include “http://” at the beginning of the parameter.

    tcBookmark

       I not empty, the parameter contains a name of a bookmark that will be created and will navigate to this text.

    tcTooltip

       The tooltip displayed when hovering mouse over this text.

     

    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:

    Code Block
    XFRXDraw::DrawTextBox(tnLeft, tnTop, tnWidth, tnHeight, tcText[, tnAlign[, tnVAlign[, tnRotate[,tnRotationPoint[, tcLinkName[, tcLinkRef[, tcBookmark[, tcTooltip]]]]]]]])

    Return value:

       The height of the bounding rectangle is returned.

    Parameters:

    tnLeft, tnTop

       The X and Y coordinates of the upper left hand corner of the bounding rectangle.

    tnWidth, tnHeight

       The width and the height of the bounding rectangle. If tnHeight is 0, the rectangle stretches to accommodate to full text and the height of the rectangle is returned.

    tnAlign

       The horizontal alignment of the text inside of the rectangle. The allowed values are:

    0  … “left”

    1   …“center”

    2  … “right”.

    Optional, the default value is 0 (left).

    tnVAlign

       The vertical alignment of the text inside of the rectangle. The allowed values are:

    0  … “top”

    1   …“center”

    2  … “bottom”.

    Optional, the default value is 0 (top).

    tnRotate

       The text rotation angle in degrees. The label will be rotated counterclockwise. Optional, default value = 0.

    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

       If this parameter is filled, the text will be a named target of a hyperlink. (see tcLinkRef parameter).

    tcLinkRef

       If this parameter is filled, the text will be a hyperlink. It will navigate to a target with tcLinkRef name.

    tcBookmark

       I not empty, the parameter contains a name of a bookmark that will be created and will navigate to this text.

    tcTooltip

       The tooltip displayed when hovering mouse over this text.

     

     

    GetBounding
    Rectangle()

     

    Returns the bounding rectangle coordinates in the rectangle-bound script.

    Syntax:

    Code Block
    XFRXDraw::GetBoundingRectangle()

    Return value:

       NULL  -  the bounding rectangle is not available  

       Object – an object with the following properties:

        nLeft, nTop – the coordinates of the upper left hand corner of the rectangle

        nWidth, nHeight – the width and height of the rectangle

     

       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:

    Code Block
    XFRXDraw::GetXPos()

     

    GetYPos

     

     

    Returns the vertical coordinate of the current position.

    Syntax:

    Code Block
    XFRXDraw::GetYPos()

     

    OpenDocument()

     

     

    Opens an existing XFF file.

    Syntax:

    Code Block
    XFRXDraw::OpenDocument(tcFileName)

    Return values

    .T. … the file was successfully opened

    .F. … file couldn’t have been opened (file doesn’t exist or is locked)

     

     

    PrintDocument()

     

    Prints the XFF file to the specified printer.

    Syntax:

    Code Block
    XFRXDraw::PrintDocument(tcPrinterName, tcJobname, tnFrom [, tnTo[, tcDEVMODE]])

    Return values

    -100 … cannot initialize printer

          0 … no errors

     

    Parameters:

    tcPrinterName

       Then name of the printer to which the document will be sent

    tcJobName

       The printer job name

    tnFrom

      If numeric, the first page to be printed.

    tnTo

      The last page to be printed.

     

    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] ] ] ] ])

     

    Return values

     0 ... no errors was encountered

    -1 ... unknown image format

    -2 ... page out of range

     

    Parameters:

    tcFilename

      The name of the file to be generated.

    tcType

      The format of the picture to be saved. Currently supported options are: BMP, GIF, JPEG, PNG, TIFF.

    tnFrom

      The page number to be saved. If TIFF format is being saved, the parameter specifies the first page to be saved.

    tnTo

      If TIFF format is being saved, the parameter specifies the last page to be saved. Ignored otherwise.

    tnBpp

      Bits per pixel. Currently supported values are 2, 16 or 24.

    tnJPEGQuality

      Specifies the JPEG compression quality. The range is from 1 - the lowest quality to 100 - the best quality. The default value is 0 - default quality. Ignored for other output types.

    tnThumbnailWidth

      The width of the output picture in pixels.

    tnThumbnailHeight

      The height of the output picture in pixels.

     

    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:

    Code Block
    XFRXDraw::SetColor(tfr, tfg, tfb[, tbr, tbg, tbb])

    Parameters:

    tfr, tfg, tfb

       Red, green and blue components of the foreground color

    tbr, tbg, tbb

       Red, green and blue components of the background color (optional)

     

     

    SetFont()

     

     

    Sets font name and attributes for subsequent DrawText() or DrawTextBox() calls.

    Syntax:

    Code Block
    XFRXDraw::SetFont(tcFontName, tnSize[, tlBold, tlItalic, tlUnderline])

    Parameters:

    tcFontName

       The font name

    tnSize

       The font size in points

    tlBold, tlItalics, tlUnderline

       The font attributes. These parameters are optional, the default value is .F.

     

     

    SetPos()

     

     

    Sets the position where the text will be drawn by the subsequent DrawText() method call.

    Syntax:

    Code Block
    XFRXDraw::SetPos(tnXPos, tnYPos)

    Parameters:

    tnXPos, tnYPos

       The X and Y (horizontal and vertical) coordinates of the position. The unit of the coordinates is defined by SetUnit() method, the default unit is Point (pt).

     

     

    SetUnit()

     

    Sets the drawing units.

    Syntax:

    Code Block
    XFRXDraw::SetUnit(tcUnit)

    Parameters:

    tcUnit

       The unit code. The allowed values are: “in” – inches, “cm” – centimeters, “pt” – points and “px” – pixels.

     

    Info

    The default unit is point.

    XFCont class

    XFRX Preview container class. This section describes properties that you can modify in your custom implementation of the previewer. 


    iBook


    Controls if the bookmark should be displayed in the previewer. The allowed values are:

    • -1 = Disable bookmarks
    • 0 = Enable bookmarks but hide them (users need to click on the bookmark button to see them)
    • 1 = Enable bookmarks, always showing them
    • 2 = Enable bookmarks, but show or hide them automatically based on whether or not there are bookmarks defined in the report to preview (default)

     


    iTool


    Controls the visibility of the toolbar at the top. The allowed values are:

    • -1 = Disable toolbar
    • 0 = The toolbar will be enabled but hidden. It can be invoked via right click shortcut menu
    • 1 = The toolbar will be enabled and visible. (default)


    ShowStatus


    Controls the visibility of the toolbar at the status bar of the previewer container. The allowed values are:

    • .T. = show the toolbar (default)
    • .F. = hide the toolbar


    DisplayMessage()


    XFCont is using this method to display messages via WAIT WINDOW. Should you like to change this, you can override this method in a subclass. 

    Syntax:

    Code Block
    XFCont::DisplayMessage(tcMessage)

    Parameters:

    tcMessage

       The message to display