Print Page | Close Window

Format report at runtime

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1781
Printed Date: 29 Apr 2024 at 6:50am


Topic: Format report at runtime
Posted By: nabeelpatel
Subject: Format report at runtime
Date Posted: 28 Nov 2007 at 5:35am
Dear Brian,
 
SITUATION:
--------------------
I am using xml file as data source for crystal report, we need to represent a part of the data in the following format
 
 
*Bill of Lading                            *Certificate of Origin
*Muncipalty approval                 *Insurance Documents
*Airway Bill
 
Each of these values are represented by a tag i.e are seperate field elements.
 
REQUIREMENT:
--------------------
At times the few of the fields will not have value i.e. for a particular transaction there are no "Bill of lading" and say "Insurance Documents" in that case the data needs to be represented as follows
 
*Certificate of Origin                     *Muncipalty approval    
 *Airway Bill
 
Any idea how we can dynamically adjust the fields so as not to have any blank spaces
            



Replies:
Posted By: BrianBischof
Date Posted: 28 Nov 2007 at 9:14am
I would create a formula for each location on the report. Then in the formula test to see which fields have values and assign the proper field to the formula. Somethign like this for the first field
//First field left most column
if {BillOfLading}<>0 Then
    {Bill Of Lading}
Else
    {Certificate Of Origiin};

You'll have to do this for however many possible derivations there could be for each field (i.e. the formula might be a bit more complex). Then, put each line in a separate detail section and use a conditional formula to suppress the detail section if the applicable data has no value.

If you're looking for a lot more info on formulas and how to use them to create advanced formatting, you can check out chapters 5-7 in my new http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - CR Encyclopedia book


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window