[solved] savaaspdf is too slow

massimopasqualimassimopasquali Member Posts: 82
edited 2016-11-08 in NAV Three Tier
hi,

I used SAVEASPDF to generate e PDF from report, but It's very slow to put off the pdf document. Someone can explain me why?

thanks

Answers

  • tinoruijstinoruijs Member Posts: 1,226
    Shouldn't be slow.
    But using a SLEEP(1000) after generating the PDF is recommended.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • ara3nara3n Member Posts: 9,255
    using sleep will make it even slower.

    Does the report run slow when previewing it?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • tinoruijstinoruijs Member Posts: 1,226
    ara3n wrote:
    using sleep will make it even slower.

    Yes, you're right. Off course it will be slower. #-o
    I was confused with one of my own problems regarding SAVEASPDF and using the generated pdf after that. :)

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • massimopasqualimassimopasquali Member Posts: 82
    No I dont't use sleep, this is my code :

    //RECUPERO IL PATH DALLA TABELLA SETUP SERVIZI

    PathOnServer.GET;
    Filename := PathOnServer.PercorsoBonusGas;
    Filename += FORMAT(CREATEGUID);
    Filename := DELCHR(Filename, '=', '{-}');
    Filename += '.pdf';

    REPORT.SAVEASPDF(ReportID,Filename);
    EXIT(Filename)
  • tinoruijstinoruijs Member Posts: 1,226
    What Rashed said; Does the report run slow when previewing it?

    Does manually saving as pdf to that directory take long?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • massimopasqualimassimopasquali Member Posts: 82
    Sorry,

    I have saved the file in the directory temp on NAV server that I have recorded on my Setup "PathOnServer.PercorsoBonusGas".

    After that I have generated the PDF and after imported in the BLOB :

    BLOBRef.INIT;
    FileManagement.BLOBImportFromServerFile(BLOBRef,ServerFileName);
  • tinoruijstinoruijs Member Posts: 1,226
    That should be fast.
    Do you know how many seconds it takes to generate the pdf?
    And how many to import the pdf?

    Slow and fast are subjective terms. What person A considers slow, maybe person B considers fast.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • massimopasqualimassimopasquali Member Posts: 82
    I have generated an invoice of two pages, NAV have used 15 seconds.
  • tinoruijstinoruijs Member Posts: 1,226
    I have generated an invoice of two pages, NAV have used 15 seconds.

    Do you use an image in company information?
    Don't know if the invoice has got the same problem as the sales quote, but it could be the dataset for this invoice is too big.
    You could check the size of the dataset by using print preview and then Help, About this list, Export as xml. Then check the size of the xml.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • massimopasqualimassimopasquali Member Posts: 82
    Yes I'm using the Company image; the invoice hasn't problems, if I print on my Xerox the process uses 5 sec. to getting out the invoice printed.

    Now I'm going to check how long is the dataset
  • massimopasqualimassimopasquali Member Posts: 82
    Solved! :-)

    Thanks tinoruijs, I have had rights.

    bye
  • tinoruijstinoruijs Member Posts: 1,226
    Solved! :-)

    Thanks tinoruijs, I have had rights.

    bye

    You're welcome.
    How did you solve it?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
Sign In or Register to comment.