pdf and mail sending

viriatoviriato Member Posts: 105
Hi,

I'm generating a pdf file from a report and then sending attaching it and sending it out by email.

The thing is that everything works except that the pdf file is not build fast enough to be attached by email and sent out. How can I do make this work?

Thanks.

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi,

    Use the SLEEP command - you could have a loop until the file EXISTS and SLEEP in the loop.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • viriatoviriato Member Posts: 105
    Hi DaveT

    Thanks. Can you post me a sample just on how to use it. Thanks again.
  • DaveTDaveT Member Posts: 1,039
    Hi,

    Off the top of my head try:
    repeat
       SLEEP( 1000 );
       Cnt +=1;
    until ( EXISTS( Filename ) or Cnt > 20 );
    

    You can experiment with the values to suit you.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • viriatoviriato Member Posts: 105
    Thanks!
  • DaveTDaveT Member Posts: 1,039
    Glad to Help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • rthswrthsw Member Posts: 73
    If you generate the PDF by yourown (you can generate very fast and stable and complete fee free PDF-Generationg by Ghostscript), you can change your Systemcall from

    Shell(ProgrammcallToConvertPDF)

    to

    if shell(ProgrammcallToConvertPDF) = 0 then;

    the second Statement waits till the shell is executed, the first just executes (fire & forget).
  • viriatoviriato Member Posts: 105
    Thanks rtsw.

    Do you know where i can download this ghostscript. Do you know if it works on vista?


    Thanks!
Sign In or Register to comment.