Amyuni SetDocFileProps & Lock

ebsoftebsoft Member Posts: 81
Good morning,
I'm trying to use Amyuni lock & SetDocFileProps methods within NAV 4.0 SP3, the Amyuni version is 4.0.
I would like to avoid use DefaultDirectory, DefaultFilename and SetDefaultPrinter methods because I have many problems in multithread calls.
Here is the code i use:
PrinterName := 'Amyuni';
LockName := 'JobScheduler';
FileName := 'C:\TEST.PDF';
PDFConverter.DriverInit(PrinterName);
PDFConverter.Lock(LockName);
PDFConverter.SetDocFileProps(LockName,3,'',FileName);
Report.RUNMODAL.....
PDFConverter.Unlock(LockName,1000);
PDFConverter.DriverEnd();

I've read in the online help of Amyuni that using Lock and SetDocFileProps method instead of DefaultDirectory and DefaultFilename is the only way to avoid problems in multithread.
Here is the Online Help

With this code the printer should take C:\TEST.PDF as filename and it shouldn't prompt me for a filename.
It does not work, because when I run the code, it prompts the user for the filename.

Could you tell me where I am wrong?

Thank you very much.
Federico
Regards,
Federico

MBS Specialist since NAV 2.0
My experiences on Linkedin

Answers

  • ebsoftebsoft Member Posts: 81
    Yeah! I solved by myself!
    Ask me how!

    Alla faccia del foglio!

    PS: You can tag it as solved, thanks!
    Regards,
    Federico

    MBS Specialist since NAV 2.0
    My experiences on Linkedin
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    ebsoft wrote:
    PS: You can tag it as solved, thanks!
    No, YOU can tag it as solved. :)
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • mikmik Member Posts: 79
    Hi,

    have you ever tried this thing with amyuni 4.5? I have problems with setting the filename in the 4.5 version.

    It would be nice if you could post your code.

    greetings
    Mik

    With kind regards
    mik
  • ebsoftebsoft Member Posts: 81
    mik wrote:
    Hi,

    have you ever tried this thing with amyuni 4.5? I have problems with setting the filename in the 4.5 version.

    It would be nice if you could post your code.

    greetings
    Mik

    Hi, I don't have the solution under my hands now.
    I'm working from another customer. But the version I used is not 4.5, I'm sure of this.
    The code I used is posted above.
    Regards,
    Federico

    MBS Specialist since NAV 2.0
    My experiences on Linkedin
  • mikmik Member Posts: 79
    Hi,

    thanks for your fast reply. We are stopping the dev. for Amyuni now. There is another good printer we will test in the next month.

    With kind regards
    mik
  • ebsoftebsoft Member Posts: 81
    mik wrote:
    Hi,

    thanks for your fast reply. We are stopping the dev. for Amyuni now. There is another good printer we will test in the next month.

    I'm using PDF Creator since 2009.
    It's perfect for us. and free.
    But with NAV you should use versione 0.8
    Regards,
    Federico

    MBS Specialist since NAV 2.0
    My experiences on Linkedin
  • TimSimmondsTimSimmonds Member Posts: 47
    Hi,

    Can you rmember what was the solution? We are having a similiar issue.

    Basically the line;

    PDFConverter.SetDocFileProps(LockName,3,'',FileName);

    ...doesn't appear to work. When printing, the dialog box to enter an output file still appears.

    Many Thanks.
  • TimSimmondsTimSimmonds Member Posts: 47
    I solved it myself too. :D ...

    The lockname needs to be the document name that would normally be sent to the print queue by NAV (usually the report's caption).

    So, for example, if are printing r205 Order Confirmation to convert to a PDF, you would assign "Order Confirmation" to the "lockname" variable.
Sign In or Register to comment.