1. Jon Stoller
  2. PowerBuilder
  3. Tuesday, 13 November 2018 21:09 PM UTC

I am using PowerBuilder 2017.  The database is MS SQL Server 2016. 

My application has a function that creates a PDF with the following code:

ls_folderfile = "\\APPSERVER\PDF\picklist870024818111309365604.pdf"   
adw_rpt.Object.DataWindow.Export.PDF.Method = NativePDF!
adw_rpt.Object.DataWindow.Export.PDF.NativePDF.CustomSize=0
li_return = adw_rpt.SaveAs(ls_folderfile, PDF!, true)
etc...…….

NOTE:  adw_rpt is a datawindow type argument passed by reference to this function sent from another object.

It works correctly on my PC where I develop and "test-run" the application.  I am using a windows 10 PC. 

However, when I install it on my client's system I am having a problem. 
The PDF contains the wrong data. It creates the PDF with data that is not currently contained in adw_rpt.   It is picking up a datawindow used previously in the same function, as if it was in memory . 
One time it re-created just page 5 of a PDF it created earlier the same day. 
Another time it re-created a PDF from a few days before. 

It looks like one user gets the information from the last PDF created by another user. 

What can cause this?
Am I doing something wrong? 
Is there something I can do to make sure it creates the PDF with the correct and current datawindow data. 

Thank you for any help

Jon Stoller
AKA Software
973-720-8211
jon@akaware.com

 

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 13 November 2018 21:33 PM UTC
  2. PowerBuilder
  3. # 1

Hi Jon;

   The PB2017R3 version, the NativePDF feature first creates an interim work file in an EMF (Enhanced Meta-file Format) format in the target folder where the PDF is to be generated. The NaivePDF feature uses a 2 phase generation where the EMF file is created first, then the PDF is produced from the EMF. At the end, the PB run-time cleans up the EMF work file.

   What I am wondering is because you are using a UNC (uniform naming convention) based path statement, whether the App user at run-time has network File Delete privileges? If not, I suspect that the DeleteFile() fails silently and when the PB App tries another SaveAs (PDF!), the old EMF work file is used because the UNC user may not have file "replace" privileges either. Hence, the PDF generated continues using the old EMF file datum.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.