Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: conditional section Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Sep 2009 at 2:51pm
Better one to handle in case you run into items that are 2 characters (e.g. 12 instead of 02):
 
totext(ToNumber(RIGHT({?period},2))-1,'00',0) + ' Balance'
IP IP Logged
kirandb
Groupie
Groupie
Avatar

Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
Quote kirandb Replybullet Posted: 09 Sep 2009 at 5:53am

Thanks. It works great. HOw do i use a formula within a formula. Say my formula "Prior" gives me previous year,previous quater based on the user parameters and if i want to use this formula to populate my headers which says uses a formula

"Col6" = "Prior" + 'Balance'
 
Any suggestions.
 
share your knowledge
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Sep 2009 at 7:02am
I am not sure what youa re asking here...Do you just want a text string as a label in a header?
IP IP Logged
kirandb
Groupie
Groupie
Avatar

Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
Quote kirandb Replybullet Posted: 09 Sep 2009 at 7:05am

I have a formula which gives me say previous year. Now I want to use this formula within another formula which gives me my header string. So I want to know how to implement a formula within a formula.

share your knowledge
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Sep 2009 at 7:13am
It all depends on what the first formula is doing and what data type it is.
If prior is a string/text:
"Col6 = " + {@prior} + " Balance"
if prior is numeric:
"Col6 = " + totext({@prior},0,"") + " Balance"
would give you a string of "Col6 = 2006 Balance"
 
You can also just make a text and drag and drop fields into it including formula fields.
 
IP IP Logged
kirandb
Groupie
Groupie
Avatar

Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
Quote kirandb Replybullet Posted: 09 Sep 2009 at 7:36am
Great. I have a report header to display the date time. the formula i used is :
'Report As of ' + MonthName (Month(CurrentDate)) + ' ' + ToText(Day(CurrentDate),'00',0) + ', ' + Totext(Year (CurrentDate),'0000',0) + ' at ' + ToText(TimeValue (CurrentDateTime))
 
this gives me the data as say : Report as of September 09, 2009 at 9:23:45AM.
How do i eliminate the seconds from the above formula and alos add leading zero for hour and seconds if they are single digit.
share your knowledge
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Sep 2009 at 8:04am
'Report As of ' + totext(currentdatetime,"MMMM d, yyyy 'at' h:mm:ss tt")
 
IP IP Logged
<< Prev Page  of 2
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.031 seconds.