Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crosstab formatting Post Reply Post New Topic
Author Message
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Topic: Crosstab formatting
     Posted: 23 Feb 2009 at 4:31am

Hi Folks,

Hope someone can help.. I'm using crystal 10 to design a report with a cross tab.

I need to know how to format a crosstab cell to display a  * (asterisk) if the no is lower than a certain value.

I've been trying to use the formula below , but it errors due to string value

IF CURRENTFIELDVALUE < 20 then
"*"
 
 
Hope someone knows the answer to this.. thanks
Craig
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 23 Feb 2009 at 5:00am
Hi
 
Can you post the sample data for Cross Tab and where do you want the * to displayed i.e. rows or Columns
 
Cheers
Rahul
IP IP Logged
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Posted: 23 Feb 2009 at 5:04am
Hi,
I just want to format one Cell in the crosstab.  Its is a nuremic sell (Total no of books).. If the value is less the 5 I just want to display a * rather than a value in that cell.
 
ie.
 
Title         Value
Book1      20
Book2       15
Book3       *   
 
Hope this makes sence,
Craig.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 23 Feb 2009 at 5:15am
Hi
 
Try this code
 
IF CURRENTFIELDVALUE <  20 then "*"
ELSE
totext(CURRENTFIELDVALUE)
 
Cheers
Rahul
IP IP Logged
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Posted: 23 Feb 2009 at 5:20am
Error=  The formula result must be a Boolean...
 
I'm placing the formula inside the  SUPRESS (x-2) button under Common.
 
Craig.


Edited by cajsoft - 23 Feb 2009 at 5:22am
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 23 Feb 2009 at 5:25am
Hi
 
Place this formula inside Display String x+2 In common Tab
 
Cheers
Rahul
IP IP Logged
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Posted: 23 Feb 2009 at 5:56am
Thanks Rahul,
That done the trick..
 
Only problem is that the value if greater than 20 is being displayed with decimal places ie.  20.00  but I cant format it as number anymore due to the value now being of string.
 
craig.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 23 Feb 2009 at 6:03am
Hi
 
Just change the code to below
 
IF CURRENTFIELDVALUE < 20 then"*"
ELSE
totext(CURRENTFIELDVALUE,0)
 
Cheers
Rahul
IP IP Logged
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Posted: 23 Feb 2009 at 6:05am
Thanks Again Rahul,
Works Great!!!
IP IP Logged
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