How can I explode a report and deliver the resultant exploded pages via multiple delivery methods in one process?


I have around 1200 Invoices monthly to be processed. Not all of them can be emailed. Some will need to be faxed and others will be printed and delivered via the postal service. Is that possible in one batch process? It would really save me time and money!


Delivery is what PDF-eXPLODE does best and conditional delivery via multiple delivery methods (like e-mail, fax or postal service or even archived to some intranet shared folder) based on some field condition is what is done even better with some "help" from your report writer.  The following method has been trialed and tested in both Crystal Reports and MS Access; but it can be achieved with other report writers too provided they have a facility to create an IF-THEN-ELSE function.

You will need to either have access or possess Fax server software (and appropriate hardware), installed on your PC or server  or you can obtain Fax service over the internet from a number of Internet Service providers - just search in Google and obtain cost quotes. Most 3rd party e-mail based Fax Service Providers charge by the number of pages faxed to a particular phone number - so it is important to suppress unnecessary pages like an email "cover sheet" message as you would have with a normal email/attachment. The Fax server should just send a fax of the exploded PDF attachment (for example - your invoice). Let us assume you are processing Invoices.

it is best to use Variables. So set up two variables in your Tag with the first one being the File name. Select Variables Settings in the Options menu and click on the File Name tab. Check the box 'Use Variables for exploded file name' , and select Fullname, and Var1  in the 'Variable to use for File name' . The second variable will be either the Customer ID or Customer Name to be used in the email. Check the box "Use variables in emails"  

Now create 3 Message ID's under "Default Message ID Tags" - EmailIT, FaxIT, PrintIT, assuming you are trying to send to those 3 delivery modes.

In the EmailIT Message ID, insert a Subject/Message/Exploded File Path.  

In the FaxIT create a Subject and exploded file path. Use only  <Var1> <Var2>  in the text line of the Subject. At runtime, this would provide a reference to the invoice number and customer. Fax servers use the Subject content to send back a reference if the fax fails.

In PrintIT, keep message and subject blank and create an Exploded file path as well as show "PrintInvoices" on the File Name line in the 'Exploded File/Path" tab of the Message ID. At the end of the processing, you will have one PDF with the filename PrintInvoices.pdf to be printed. 

The tag in the report design will be populated from a formula ('function'). 

In the Report Writer,
Create the following formula called "PeXTag"  (suitable for Crystal Reports - '//' means that text on the line which follows, is a comment)

 If Trim({}) < > "" then
              //Found an email address in the email field: Use the Message ID EmailIT
               "<pdfexplode>"+ {Var1}+","+ {Var2}+ "%EmailIT#"+trim({CONTACTS.EMAIL})+"</pdfexplode>"  
               If Trim({customer.Fax}) < > "" then     
                           //Found a  Fax Tel No in the Fax field: Use the Message ID FaxIT ---need to change the Faxserver email to the required email format
                         "<pdfexplode>"+ {Var1}+","+ {Var2} +"%FaxIT#"+trim({CONTACTS.Fax})+"</pdfexplode>"  
                          //Have to print this Invoice later - accumulate all exploded PDFs into one file called PrintInvoices (as configured in Message ID)
                        "<pdfexplode> ,%PrintIT#</pdfexplode>"
               End if
// End If  //you may need to uncomment 'End If' in some older versions of Crystal Reports

Check and then Save this formula.  Note - in the code above, the {Var1} and {Var2} actually refers to the Crystal Data Fields [Invoice No] and [Customer ID] respectively, and is not intended to be Text of value "{Var1}"

NOTE: Most Fax servers have a "receiving" email format which consists of Fax Tel No + "@fax server domain .com. Hence the fax email shown in the example picks up the fax no in the DB as{CONTACTS.Fax}

Now create a blank text control, the width of the page and inserted into the Page Header. Then drag the formula field PeXTag into the field and it will display as @PeXTag. Now make the font 7 pitch, Arial and white in color. Then run the report and print to PDF-eXPLODE . You may have to customize the tag to suit the rules for your fax server.

At the end of the PDF-eXPLODE Print process run, your PrintIT PDF will consist of one PDF called PrintInvoices and will be located in the PrintIT Message ID Exploded  File Path folder ready to be opened and printed. You can (if you wish) produce multiple Invoice PDFs for printing by making the following change to the Crystal Reports PrintIT tag as follows:

                          //Have to print this Invoice later - accumulate all exploded PDFs into one file called PrintInvoices (as configured in Message ID)
                        "<pdfexplode>" + {Var1} +",%PrintIT#</pdfexplode>"

In PDF-eXPLODE, change your PrintIT Message ID to remove the File name "PrintInvoices" under the Exploded File tab and on the front of the Message ID, check the Print box and show the desired local Printer to send the individual PDF to the configured  printer.

Posted - Sat, Nov 29, 2014 at 10:33 PM. This article has been viewed 4831 times.
Online URL:

Powered by PHPKB (Knowledge Base Software)