Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foxypreviewer

Status
Not open for further replies.

John Stephen

Programmer
Jan 29, 2019
50
AU
I am running FoxyPreviewer v3.00.247 2023.12.10 Windows 11.
My problem is that when outputting to a PDF data from the previous PDF (in this case a previous invoice) is superimposed on the current PDF. Almost as if the previous PDF data is not being cleared. In older versions I issued a RELEASE after each Foxypreviewer session
Now I am leaving Foxypreviewer as recommended
Here is the startup code
DO FOXYPREVIEWER.APP WITH "CLEAN"
_Screen.oFoxyPreviewer.cUser = ********
_Screen.oFoxyPreviewer.cSerial = *******************
_Screen.oFoxyPreviewer.nRenderMode = 2
mFullFoxyVer = _Screen.oFoxyPreviewer.cVersion

Here is the code I use to produce the PDF
IF nFoxyVersion >=3
REPORT FORM (mReportName) TO FILE (mDestination)
ELSE
DO FoxyPreviewer.App WITH "CLEAN"
REPORT FORM (mReportName) OBJECT TYPE 10 TO FILE (mDestination)
DO FoxyPreviewer.App WITH "CLEAN"
ENDIF

Should this be the other way around ie because the mVersion is 3 or greater I should be using the CLEAN option
I guess I am asking if the CLEAN option clears any old data?
TIA John
 
I would expect any version TO FILE to overwrite and not extend a file or even overlay results.

How about solving the issue by adding a timestamp to the filename? I.e. set mDestination=...+ ttoc(Datetime(),1) or ...+Dtos(Date(), if date is sufficient.
You also can easily ERASE (mDestination) before running the report as that doesn't error if no file (mDesitination) exists. It could only become problematic when anything keeps a file handle open.

If you generate files and mail them, I would also move them to an archive directory of sent items, if you don't rely on sent mail items to keep that record, then in the next run there should bve no files to overwrite anyway.

Chriss
 
Hi Chris
I doubt that is the problem
Each file generated (mDestination) has a unique name consisting of the customer code and invoice/docket number plus each pdf generated is deleted when the email has been either successfully sent or even if not sent due to a connection error.
My client is generating and sending hundreds of invoices throughout the day so I suggest the problem is in the generation of the PDF
In the past we fixed problems like this by re-booting the workstation suggesting that some buffers were full (maybe workspace in the Windows Temp folder)
I am getting the client to re-boot his workstations and the data server. If that fixes the problem I will post here
Thanks for answering anyway
Regards
John
 
Further to this issue:
My client re-booted his computers and the problem went away which brings me to why is this still happening?
Is this a FoxyPreviewer issue or a Windows issue?
Is there any way to clear the workspace without re-booting the computer?
Thanks
John
 
Well, according to the documentation of FP3 the meaning of CLEAN is:

new in FP3 said:
Clean - A faster initialization, loading only the needed ReportListeners for all the outputs. The good and old "OBJECT TYPE" mode will not be available, but "REPORT FORM YourReport.Frx TO FILE xxxxxx.pdf" will do the same job. Recommended setting. It was not set as default to keep backwards compatibility.
See
So that's not what you want to use with OBJECT TYPE in your REPORT FORM commands.

I can't imagine the report engine to reuse anything of previous report runs, unless you generate graphics and refer to them,i.e. I don't think it's FPs fault. There's also no cleaning of TEMP folders, for example, with a restart, unless you explicitly run a temp cleaning.

Anyway, I think you should look into other places and how you build up the report.

Chriss
 
Thank you for your thoughts on CLEAN etc
From experience re-booting the workstation has worked for years and because it works in this case I will stay with that option
From yesterday when each and every invoice was blended with others to today (after the re-boot) when all invoices print correctly the only difference was the re-boot I am happy to continue along those lines.
Regards
John
 
Completely understandable.

Just notice I didn't post my thoughts, just quoted what's said on the FP homepage. Also, if you ignore "OBJECT TYPE" mode [highlight #FCE94F]will not be available[/highlight] and still run REPORT FORM calls with OBJECT TYPE after initializing WITH "CLEAN", I can't help you.

the other part of it saying: It was not set as default to keep backwards compatibility. means, IMHO, you can stick to all your REPORT FORM commands as used with previous FP versions up to 2.99 when you don't use the WITH "CLEAN" initialization.

Anything else and what you already seemed to have experíenced before changing to FP3 is very very likely also not coming in from the version change but a systematic problem you already had before, isn't it?

If you want the FP developers to address problems you should use their github to report an issue.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top