Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Switch does not display text Post Reply Post New Topic
Author Message
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Topic: Switch does not display text
    Posted: 16 Jun 2007 at 10:12am
I wrote the Switch statement below and it works fine except that for the first condition were it test for NULL it does not display the text when that condition is true. By the way I am using it to group on six (6) departments. So it will display a group header for "Cost of Goods" or "Administrative" but for the group that test for null the group header text is BLANK. Any Ideas on how to fix this?
 
Switch
(
{@Null Test} = 1, "01 Sales",
{@Code Base 2} = 1, "02 Cost of Goods",
{@Code Base 3} = 1, "03 Marketing & Business Devel. Expenses",
{@Code Base 4} = 1, "04 Administrative",
{@Code Base 5} = 1, "05  Growth Expenses",
{@Code Base 6} = 1, "06 Other Operating & Administrative Expenses"
)
Rob
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 16 Jun 2007 at 1:33pm
Can you show us the {@Null Test} formula? I'm guessing that something is wrong there. Nulls are tricky and can cause unexpected results. Otherwise it shwould act as you are expecting.
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
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 16 Jun 2007 at 4:31pm
//  Code_b Code testing for grouping Structure
If (isnull({ACCOUNTING_BALANCE.CODE_B}))
   
Then
    1
else
    0;
 
This null test works fine as far as I can see. It is evaluated correctly and let's me create the groups that I need for a report with the exception of returning text for the group.
Rob
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 17 Jun 2007 at 9:33am
Well, that looks fine. Another thing to consider is the order of precedence for formulas. If all formulas are in the report pass then you can't 'truly' predict which ones will run first. So I wonder if the @Null formula hasn't been called yet? You can use EvaluateAfter() to force a formula to run after another formula. Does that sound like it might help?
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.031 seconds.