Generate separate PDF files of invoices from Crystal Report and send them by email to customers

Dear community,

we are trying to understand if a specific action is achievable with Crystal Reports.

At the moment we are printing invoices by customer and invoices range and we get one PDF file with all the invoices inside. This file is then sent to the customer by a specific workflow we created.

We have customers who are asking to receive one PDF file per invoice and not the whole range in one file. We stumbled upon the segmentation parameter but it is really unhandy to use because you need to know in advance the invoices protocols.

My questions are

  • is there a way to instruct Crystal to create one file per invoice without the need to pass through the segmentation parameter list?
  • once done the previous step, how can I send all the files as attachments in one email to the customer?

Thank you in advance.

AF

  • 0

    This is known as report bursting. Several of the 3rd-party Crystal Reports tools listed here provide this functionality.

    I just recorded the following video demonstrating how this works with my Visual CUT software:
     

    There are several ways to email individual invoices as multiple pdf attachments to each customer. One way is to burst the invoices to different folders based on Customer name. You can use another report grouped by customer and specifying the multiple attachments using a dynamic wildcard expression (e.g. c:\Invoices\{CustomerName}\*.pdf) to email all the invoices belonging to each customer. You can combine the processing of the two reports (one to burst and one to email) using 2 command lines in a single batch file.

    If that folder contains older invoices that should not be attached, include in the dynamic export file name a date so that the wild card expression for the email attachments can select only the invoices from the current run. For example, c:\Invoices\{CustomerName}\*{[MM]}_{[dd]}_{[yyyy]}.pdf

    It is also possible to combine the whole process into a single report with more complex {@toEmail} formula that returns the customer's email address only for their last invoice. 

  • 0

    Alessandro, we've done this before by code. Maybe there are other options, but, in my case, I did a function which selects invoice by invoice and send them to PDF file (call ETAT) , all together in one directory, in groups per customer. When changing the customer in the select, the program sends one email by calling MELADX. You can see some examples here:

    https://en.sagedev.it/sagex3/send-mail-from-code-with-attachments-sage-x3/

    I hope it helps

  • 0

    Hi Alessandro,

    Another suggestion... You could try to use the EDI functionality to send those PDFs. It would be one email per invoice, if that's ok for your customers.

    Regards,

    Alex