Friday, April 27, 2012

Suppressing blank lines in Crystal Reports

Here is the latest Crystal Reports tip from the Flexible Solutions GP Reports June 2009 newsletter: how to work with addresses. Dynamics GP (and probably many other systems) stores address components in separate fields, so if we look at a customer address window there are many individual fields that make up an address:
customer address window
It is entirely possible that many of these fields will be blank, but we need to account for them on reports like customer invoices and statements just in case there are records where these fields are not blank.
If you simply add all the address fields individually to a report, here is what the report design will look like:
individual fields
And the results would be:
individual fields results
To get the address to appear without any blank fields, instead of adding each field individually to your report, use a  text object:
  1. Go to Insert > Text Object.
  2. Place the Text Object in the area where you will want the address and make it at least a few lines tall, you can always resize the text object as needed later.
  3. Drag each address field inside the text object in the order they should appear. Insert carriage returns and additional spacing or punctuation where needed between the fields:text object
  4. Right click on the text object and choose Format Text. On the Common tab check Suppress Embedded Field Blank Lines. On the same tab, Can Grow is also useful – this lets you make the text object the size of your typical address and if the address is larger, Crystal will automatically adjust the size of the text object and the rest of the report:text object format editor
  5. Click OK and take a look at your results, they should now look a lot nicer:text object results
For more Crystal Reports tips, check out the Working with Crystal Reports section on myGP Reports page. Past Flexible Solutions GP Reports newsletters can be found on theFlexible Solutions website. And if you’re looking to replace Dynamics GP Sales Order Processing (SOP) reports with Crystal Reports, take a look at this demo video.

No comments:

Post a Comment