Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Show Field in a textobject with syntax Post Reply Post New Topic
Author Message
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Topic: Show Field in a textobject with syntax
     Posted: 29 Dec 2009 at 2:17pm
Hi All,
 
I have a  3 fields in my detail section and want to show one field  in a textobject.
 
example:(detail section)
field 1       field 2           field 3
A               Y                    Y
 
in the options for a textobject you can add a background color and write a formula for this.
 
i have the following formula:
if RecordNumber mod 2 = 0  ( or 1)  and {field 2}='Y' and {field 3}='Y' then crRed else crGreen.
 
what kind of syntax do i need to show the content of field 1 in the textobject if it is crRed?
 
 
regards,
Memoli
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Dec 2009 at 2:40pm
I am not sure I understand your question or exactly what you want to do here but you can conditionally suppress the field itself using the same criteria but returning a boolean:
RecordNumber mod 2 = 0  ( or 1)  and {field 2}='Y' and {field 3}='Y'
 
or you can create a formula field to replace it using that same formula theory and then use the formula field instead of the original field:
if RecordNumber mod 2 = 0  ( or 1)  and {field 2}='Y' and {field 3}='Y' then table.Field1 else ''
 
IP IP Logged
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Posted: 29 Dec 2009 at 3:19pm
Dear Dblank,
 
thanks for your reply.
 
basically what i want to do is to show the content of a field in a textobject with some criteria's.
so every record in the detail section must be checked by a crystal syntax and if it meets the criteria's then in the textobject the content of a field (which i want to see) must be filled in.
 
i tried the second option and it seems working a little bit.
 
Let me try it tomorrow at work and let you know the result.
 
 
many thanks again.
 
regards,
memoli
IP IP Logged
Memoli28
Groupie
Groupie
Avatar

Joined: 10 Apr 2009
Online Status: Offline
Posts: 58
Quote Memoli28 Replybullet Posted: 02 Jan 2010 at 5:05am
Hi Dblank,
 
happy new yearSmile
 
I tried several things but no correct results.
 
i have the following set up in my report:
 
Group 1 (Dock)    
4                            Group 2 (Cargo)    loaded      loading started
                                 A                              Y
                                 B                              Y
5 
                                 C                              Y 
                                 D                              N                     Y
7   
                                 F                              N
8
                                 G                             N
9
                                 H                             N
10       
                                 X                             N                       Y
15       
                                  Y                             N
17        
                                  Z                             N
 
what i want to do is ,add textobjects in one section,every textobject represents the dock,
and give background colors when criteria's are matched.(status 1 or 2 or 3)
I want to give three colors:
Red: if the dock is occupied,means not loaded
Orange: if the dock is  under loading,means loading started
Green: if there is no record,means dock is available.
 
As you can see,at one dock there can be more cargo's,example above:
dock 5 :cargo C is loaded  ,cargo D is under loading,so this should get orange color in the textobject as backgroundcolor.
 
I have already created a formula for the status of the dock,which returns 3 values:
status 1:Occupied  (RED)
status 2:Busy          (Orange)
status 3:Not occupied (Green)
 
So,what i need to do is the following:
first:
create a formula for group 1 (dock) and check every record (group 2) and return one of the above values.
 
i thought it was possible with Recordnumber mod,but this did not worked.
 
second:
create a formula for the background-color for an textobject ,which checks every record on grouplevel.
if the formula finds a record ,and depending on the status it gives the correct color.
if he doesnot find a record it will be green.
 
 
i think i have to use local variables or shared variables,but i am not familiar with this syntax.
 
i hope it is clear for you.
 
regards,
memoli
 
 
 
 
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