I have FRX2Any version 14.02.00 and am having issues with adding to my PDF in the correct order. I am creating a PDF statement that contains several different reports. The first report I create looks fine but the subsequent report seems to overwrite the first report even though I have the cAddTo set appropriately with the same file location and I have the nAddtotype set to 1.
What could I be doing wrong? If I pause my app after the first report I can see it there, then let it go to the second report and it is then only the second report - duplicated so that the second report appears twice now.
This is essentially my procedure for creating the PDF. I am creating and releasing the object between reports in case that can cause an issue.
********************************************************************************************************************************************************
lcFRX2AnyLibrary = 'FRX2Any'
SET CLASSLIB TO &lcFRX2AnyLibrary IN FRX2Any.APP ALIAS FRX2Any
loFile = CREATEOBJ('FRX2Any.PDFFile')
IF TYPE('loFile') = 'O'
*-- Unlock FRX2Any
loFile.UNLOCK('XXXXX') && I Removed the unlock code for posting
*-- NOTE: loFile.cExportFileName should not include file extension. For example: loFile.cExportFileName = "ReportOutput"
loFile.cExportFileName = JUSTSTEM(pcPDFName)
* Not first page then add to the existing PDF
IF plAppend = .T. && plAppend tells me if I need to begin appending to the existing file
loFile.cAddTo = pcPDFName+'.PDF'
loFile.nAddtotype = 1
ENDIF
*-- NOTE: loFile.cSaveFolder should contain only path to the output file. For example: loFile.cSaveFolder = "c:\MyApp\MyOutPut\"
loFile.cSaveFolder = ADDBS(JUSTPATH(pcPDFPath))
*-- Force FRX2Any to display conversion process status
loFile.lDisplayStatus = .T.
*-- Specifies that output file will be displayed after creation
loFile.nOutPutType = cnOUTPUT_FILE
*-- Force FRX2ANY to use localized name of the font(s).
*-- Set up this property to true, if your OS used translated font names (Arial Fett, Arial Negrita, Arial Italique)
loFile.lTranslateFontStyle = .T.
*-- Specify a Code Page.
loFile.nCodePage = 1252
xcReportForm = LEFT(SYS(2005),RAT("\",SYS(2005)))+pcReportName
lnResult = loFile.SAVE(xcReportForm)
IF lnResult<>0
=MESSAGEBOX('PDF Creation Error#: '+ALLTRIM(STR(lnResult)),16,'PDF Create Error')
ENDIF
loFile.RELEASE()