Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

Password protection

This paragraph applies both to VFP 9 and VFP 8. The setPasswords method is implemented both in XFRXListener and XFRXSession classes.

To add passwords to Word documents, call SetPasswords() method before calling ProcessReport():

loSession.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 tlNotOpenViewer parameter of SetParams method is set to .F.).

Word document splitting

This paragraph applies to VFP 8 only.

When the generated documents are very long, Word application has problem with the conversion - it takes very long to convert it. To avoid this problem, XFRX can split the generated document into more smaller documents. To set this up, call SplitDocument() method before calling ProcessReport():

loSession.SplitDocument(tnPages)

tnPagesp is the number of pages each of the resulting documents would have.

Native output generation

Since version 14.7, XFRX can natively generate DOCX (OpenXML) documents. The Word application is not required and does not need to be installed to generate the documents both in the absolute and flow layout. The generated documents are equivalent to the standard word documents generated by XFRX and can be opened in Word versions 2003 (with a plugin), 2007 and newer. The output type codes are "NATIVE_DOCX" (standard) and "NATIVE_FDOCX" (flow layout). 

Overview

Output type codeStandard layoutFlow layoutOutput formatWord version needed to generateWord version needed to view
DOCyesnoDOC2000+2000+
FDOCnoyesDOC2000+2000+
NATIVE_DOCXyesnoDOCXnone2003+
NATIVE_FDOCXnoyesDOCXnone2003+

Usage 

All you need to do is to specify NATIVE_DOCX or NATIVE_FDOCX. This is a pure VFP implementation so no other setup is needed, except MD5.FLL library MD5.FLL, which is a free library implementing the MD5 algorithm. MD5.FLL was written by Duke Lotherington, Visual Records Consulting, 3944 Murphy Canyon Rd, San Diego CA 92123, duke@visualrecords.com (http://www.leafe.com/dls/vfp


Pre-VFP 9.0 mode
loSession= xfrx("XFRX#INIT")
lnRetVal = loSession.SetParams("output.docx",,,,,,"NATIVE_FDOCX")
If lnRetVal = 0
    loSession.ProcessReport("report1")
    loSession.finalize()
Endif
VFP 9.0 mode
loxfrx = XFRX("XFRX#LISTENER")
lnRetval = loxfrx.SetParams("output.docx",,,,,,"NATIVE_FDOCX")
IF lnRetval = 0
    REPORT FORM report1 OBJECT loxfrx
endif 

Developer Folder for NATIVE_DOCX/NATIVE_FDOCX  

Call SetOtherParams method with "DEVELOP" or "DEVELOPFOLDER" to define output folder for source files and folders of OpenXML.

Example:   

loSession.setOtherParams("DEVELOP",.T.)
loSession.setOtherParams("DEVELOPFOLDER","[FOLDER\]DEVELOPFOLDER")
            
  • No labels