3000AD Knowledge Base
Home » Categories » Knowledge Base Home » PDF-eXPLODE » Tips N Tricks

How can I automatically send my exploded PDF to a printer when there is no email address?

 

ISSUE:

We are still switching over to email invoices and several hundred accounts in our system now have an email address entered for crystal reports to pull info from for the tag,However there are still about 900 accounts that do not have an email address and having to enter NoEmail into the database field (which could then be assigned to a Client ID and configured to 'Print') would be a hideous task. We have an AS400 running JDE.  Crystal Reports, using a database driver, is capable of creating our Invoices. Is there a way we can use a blank tag to trigger a PDF to be auto printed?...or do you know of a method for crystal reports to auto fill a blank field with NoEmail? 

 

 ANSWER:

 

The method suggested below is very simple and can be done in 10-15 minutes.  It involves making changes to your Crystal Report first, then matching the PDF-eXPLODE Tag created in the report with a PDF-eXPLODE configuration.

 

 

CRYSTAL REPORTS TEMPLATE CONFIGURATION

 

  1. Open the CR designer interface with the desired report
  2. Right click on the Formula Fields and select NEW to create a PDF-eXPLODE Tag .  Call this formula PeXTag

Creating a new formula

3. The formula editor screen opens and you create a formula like this.

EXPLANATION :

If the {email_address} = "" then 

   '<pdfexplode>' + {order-number} + '%' + 'NoEmail#' + '</pdfexplode>'    //the order-number or invoice-number will be used to create a file name for the exploded PDF and the NoEmail# is a Message ID configured to send the PDF to any printer

else

   '<pdfexplode>' + {order-number} + '%' + 'NoEmail#' + '</pdfexplode>'  

Formula editing screen

       In the formula above I say

    • IF the email field is blank then

show the PeX Tag as <pdfexplode> + Invoice no (it is numeric so it must be converted to text) + % (which means the end of PeX Variables + a Message ID called “NoEmail”  (which we have yet to configure in Pex)  + “#” (to indicate that the word in front of # is a Message ID) + closing tag </pdfexplode>. The invoice no is used as a variable to filename the PDF as

    • Else

 there is a non-blank email address and hence construct the tag and include the email address – this tag is connected to another Message ID called “Invoices” and followed by “#” (to indicate that the word “Invoices” is a message ID, then followed by the email address which is the delivery destination of the Invoices

 

  • Now click [x-2] and ensure the Crystal Reports message says “No errors found”, if so, click SAVE and CLOSE
  • In the CR designer, drag the PeXTag formula to the designer Page header and drop it on a vacant line preferably in the header or footer but if you like the Body will also be OK to show like this and then stretch the field (which probably shows as 1 – 1.5 inch) to have a width of the page but about 0.5 inch short of the right margin
  • Make the Tag field format ARIAL / 8 pitch and for now Black font (this will be later changed to white font once we have established the report tag is working correctly and we are ready to put this report into ‘production’ (aka LIVE)

 

 Crystal Reports designer

 

  • now preview the report with data and scroll through this to check out how the tag value changes to the NoEmail# or Invoices#
  • Now we are ready to configure this in PDF-eXPLODE 

 

PDF-eXPLODE CONFIGURATION 

  • Click the PDF-eXPLODE shortcut to start the program and when the screen Print queue opens, click the PRINTER/ PDF-eXPLODE Options menu item
  • The Options screen opens for configuration customization and on the General Settings, select the field options as indicated by the red highlight

 PDF-eXPLODE Options

  •  Now select the Variables Settings

Variables Options setting

 

  • Now click on Default Message ID and on the right hand side of the screen click the NEW button and then enter as shown below

 

  • Click APPLY when done – this Message ID matches the “Else” part of the PeXTag formula.
  • Click NEW to add another Message ID to match the IF part of the formula – “NoEmail” and complete the screen as shown [Print /Only (don’t E-Mail)/ Printer Name = DELL / No of Copies = 1]

Message ID Options

 

 

  • You now have to set up the email settings and test them from the Mail Settings screen. You can use MS Outlook to quickly send emails.  MS Outlook will be available in PDF-eXPLODE if you have it installed on your PC,  and it is the default email client; else use the PDF-eXPLODE SMTP. Get the same settings from MS Outlook

Email Configuration

  • Click SAVE to exit the configuration and then close the PDF-eXPLODE print queue.
  • You can now run your Crystal Report Invoice template and verify that you receive the email.
  • Once you have satisfied yourself it works, then change the Crystal Reports “PeXTag” field to white font.

 

 

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.