Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditionally print based on value in a field Post Reply Post New Topic
Author Message
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Topic: Conditionally print based on value in a field
    Posted: 04 Mar 2009 at 10:04am
I have a table that contains a counter which identifies what type of fee it is.  For instance
ID    Counter   Amt
193   1                32.00
193   2                24.00
 
I am modifying a report that has text in GF3
Program Fee:     I want $32 to display here since counter 1 is a prog fee
Discount Fee:    i want $24 to display here since counter 2 is a disc fee
 
Originally the report used 1 view but I had to join another view which contained the fees.  The report has several groups:  title of course, course id.
I am rather confused on how I can get the proper amts to display.
 
The views are joined by taking the course id to the activity fee.
 
Cry
Thanks in advance
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Mar 2009 at 6:43am
I am assuming that you want the 2 lines in GF3.  The simplest way is to create some formulas.  3 of the 4 needed are really simple, 1 sets the values back to 0, 2 display the desired amounts, the remaining formula increments...so say we want a total of values in G3.
 
In GH3, place a formula like:
shared numbervar C1:=0;
shared numbervar C2:=0;
""
 
in Detail, formula like:
shared numbervar C1;
shared numbervar C2;
 
if {table.Counter} = 1 then
  C1:=C1+{table.Amount};
 
if {table.Counter} = 2 then
  C2:=C2+{table.Amount};
 
""
 
In GF3 there are 2 formulas:
One is:
shared numbervar C1
the other is
shared numbervar C2
 
You would place the last 2 formulas in the location of the text that is the amounts.
 
Hope this helps and isn't overkill.
IP IP Logged
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Posted: 11 Mar 2009 at 9:21am
ClapYou are totally the best.  That worked and it wasn't at all overkill.
I may need to make a modification which hopefully I should be able to.
I would need to display the same fee as C1 should there not be a C2.   I will give it a try myself and hopefully won't need to update this post.
Again THANK YOU VERY VERY much for your assistance!!! - Can you tell I am happyBig%20smileBig%20smileBig%20smile
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.