How to send crystal report by mail

SOLVED

We have a report file that is generats a PDF and we need to send it by mail once it was generated.

Documentation says that we can use "REPORT" entry point to do that.

After some tests, we see that "REPORT" subroutine is called before the report file is generated not after. Are we missing something?

Is there any event / entry point triggered after the file was really generated?

Thanks

Parents Reply Children
  • 0 in reply to Barak

    Generating the PDF is not an issue. We already do that using 4GL.

    The problem is that we need to send the PDF that was really generated but no event is triggered / available. When you do that as task, your task will ends and trigger its termination but nothing guarantees that the PDF was really generated (it can be still pending). It can work whith light PDFs (that generates quickly) but doesn't work with larger PDFs that take time to build by Crystal.

  • 0 in reply to Militaru

    1) You can just put in a sleep, I've seen that 15 seconds is enough for heavy pdf's

    2) Create a loop and keep on checking if the pdf is in the location you specified

  • 0 in reply to Israel Braunfeld

    1) Already did that, unfortunately 15 seconds is not enough for some of our PDF

    2) Already did that, unfortunately the file is there quickly (if you check existence), but it is still writing, so if you send it it will be incomplete. You can also imagine to check the file size, but this is variable, so not really a solution

    The only way we found for now is : run a batch that generates PDFs and then, one or few hours later run a batch that sends files. But this has other inconvenients as you need to keep track of file names and oher information

    It woud be much easier and reliable if a specific event would be triggerd when the file completes.

  • 0 in reply to Militaru

    I agree it would be much easier if...

  • 0 in reply to Israel Braunfeld

    I think we have a similar issue in an email with a custom routine.   Version 11 patch 8.

    We go to get the report, an invoice, and a custom routine renames the invoice.  But the invoice is not there to rename it and the invoice is not generated and nothing happens.  We run it again immediately and it always works.   

    Sage tech support worked on this and we were able to determine when the report was not generated and return the error code.   

    We tried the timing/sleep trick to no avail.   That just ticked off the users having to wait. 

    Thought about a loop to recall the print routine completely since it always seems to work on the second attempt.