3000AD Knowledge Base
Home » Categories » Knowledge Base Home » PDF-eXPLODE » Processing

How can you create a Tag that can Fax, Email and/or Print within the same process?

ISSUE:

A User posed the following question:

"Just reviewing the options for printing.  I can see that you can set it to Email and Print, or just print and not email.  It would be really nice if there was an option to ‘Email when there’s an email address but Print Only those PDFs missing an email address’, that way all the Invoices etc. that need mailing out automatically come out on the printer, and all the emails are sent automatically. is this possible?"

 

ANSWER:

You can achieve this as follows:

 Assume you use Crystal Reports as your reporting tool.  You require some basic skills in writing and manipulating Crystal reports.

1. Have a Message ID called Email_IT and one called Print_IT. 
2. In your Crystal Report write a formula called PeXTag as :

 If  Trim(Email_addr} <> “” then
   “<pdfexplode> “ + {ExplodedFileName} + “,”+ {ExplodedFolder}+ “%Email_lT#”+{email_addr}
Else

    
If  Trim(Fax_No} <> “” then 
       
 “<pdfexplode> “ + {ExplodedFileName} + “,”+ {ExplodedFolder}+ “%Fax_IT#” +{Fax_No}+ "@fax_server_email.com" 
    Else   
        “<pdfexplode> “ + {ExplodedFileName} + “,”+ {ExplodedFolder}+ “%Print_IT#”

where : 

- any text enclosed between curly braces "{}" represents a database field.

- any text ending with a '#' is a Message ID, defined in PDF-eXPLODE 

In the If-Then-Else formula above, we first check if the database field is non-blank. If True, then the Text control for the tag will be populated with the relevant Message ID Email_IT tag. This Message ID will be configured in PDF-eXPLODE Options with the relevant email subject and message and any other configuration you wish.  

ELSE

The formula will check the Fax No. field (if the email field is blank) and if contains a number, it will calculate to a Fax_IT message ID tag. For this Message ID in PDF-eXPLODE options, you would generally  only show a message if you wish to have a covering page faxed with the exploded PDF else leave the message blank but configure the Subject as the fax server uses that as the reference for the fax. Most Fax server will generally have specific instructions of what and how to configure the fax phone number as part of your email address.  

ELSE

If the Email address and Fax No. fields in the database for the current data record (as in current invoice or statement, etc.) are both blank, then format the tag as Message ID Print_IT. In PDF-eXPLODE options, select, using the Print option, which printer you would like the exploded PDF to be sent to for printing.

3. On the Message ID Print_IT, check the Print option box and select 'Print Only'

4. In Crystal Reports,  make a text control for the full width of the page and stick it in the header and insert the formula  as  @PexTag 

5. Now preview the report in Crystal Reports and verify that the invoices are correctly coded with the tag relevant to that record.

 

Comments Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code

Subscribe to Knowledge Base

Get notified when new articles are added to the knowledge base.