Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Dynamically change report column header Post Reply Post New Topic
Author Message
RealQMan
Newbie
Newbie
Avatar

Joined: 22 Aug 2007
Online Status: Offline
Posts: 25
Quote RealQMan Replybullet Topic: Dynamically change report column header
    Posted: 20 Sep 2007 at 1:37pm
Good day,

What are the ways to use to change the column title during run-time. The value of column titles changes from time to time and the report should reflect that change.

CheersCool


IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Sep 2007 at 1:45pm
Instead of using text objects for the column header, use formula fields instead. Create a formula that reflects the proper column name based upon the data being displayed.
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>
IP IP Logged
RealQMan
Newbie
Newbie
Avatar

Joined: 22 Aug 2007
Online Status: Offline
Posts: 25
Quote RealQMan Replybullet Posted: 20 Sep 2007 at 3:19pm
thanks for your suggestion, to further understand the steps i need to do write the formula, i need clarification.

Version A

January February March April

'''               '''            ''         ''


Version B

Jan07   Feb07   Mar07   Apr07
''            ''            ''            '

What i am showing you is the two variation column header will transform into. Let's believe this is a monthly report that will be include into other main reports, in another word, this monthly report is a subreport of other report. Also, the data structure remain the same even though the column title changes.

Maybe I am still new at crystal report, I am unclear on the logic for the formula... Give you please give me an example please to help me start off.

Thanks

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Sep 2007 at 3:52pm
First off, you need to identify what data in the report will cause either Version A to be printed or Version B. Once you have that, you can create the formula:
if {table.field} = "somthing" Then
    "January February March April"
Else
    "Jan 07  Feb07  Mar07  Apr07";

Drag and drop the formula into the column header area to print it.

Now, this assumes that you can put all the column headers in one formula and make everything line up. If not, create a separate formula for each column header and the only difference will be the month name that each formula returns.
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>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.