Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: table data issue Post Reply Post New Topic
Author Message
sv2284
Newbie
Newbie


Joined: 18 Mar 2010
Online Status: Offline
Posts: 17
Quote sv2284 Replybullet Topic: table data issue
     Posted: 29 Mar 2010 at 5:12am
I have a table that displays the address information on separate rows in the table
 
TYPE       VAL                                          ID
CT          Chicago                                   1234                
L1           123 Main Street                      1234
L2                                                          1234
CY          COOK                                       1234
ST           IL                                            1234
PC           60068                                     1234
PC           60056                                      4432
CY           Lake                                       4432
CT                                                          4432
L1           1453 87th Street                     4432
L2                                                           4432
 
 
I cannot figure out how to display the address information on the report.  If I put the TYPE and VAL fields in the Detail section I get an item for each instance whether there is data or not.
 
 
I tried this that someone suggested but I only get the first item and nothing else.
 

If Not IsNull ({Type.FieldName}) and ({Type.FieldName} in ["ST","CY"]) then {Type.FieldName} +":  "+{Value.FieldName} else ""



Edited by sv2284 - 29 Mar 2010 at 5:12am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Mar 2010 at 5:47am
What do you want it to look like in the report?
IP IP Logged
sv2284
Newbie
Newbie


Joined: 18 Mar 2010
Online Status: Offline
Posts: 17
Quote sv2284 Replybullet Posted: 29 Mar 2010 at 5:54am

L1 (address)

CT (City), ST (STate) PC (Zip)
 
Like  the standard address would appear on a letter
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Mar 2010 at 6:01am

Based on your other report criteria would you be able to group on ID and display the data in the group1 footer?

IP IP Logged
sv2284
Newbie
Newbie


Joined: 18 Mar 2010
Online Status: Offline
Posts: 17
Quote sv2284 Replybullet Posted: 29 Mar 2010 at 6:14am
It only displays the first item in the table.
 
how do I get all the address parts to display?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Mar 2010 at 6:29am
You will have to create variables or Running Totals.
Almost everyine else would do this via variable formuls but here is an easy way via Running Totals (RTs).
Group on
Create a RT
Name = Address
Field To Summarize=VAL
Type = MAXIMUM
Evaluate=Use  a Formula
{table.Type}='L1'
Reset=On Change of group (group1)
 
Next RT='City'
Exact same but change your evaluate formula to {table.Type}='CT'
Keep making RTs, one per address part you want to use.
Place these in the Group Footer1 to make sure you are getting the correct values.
Now you can create a formula using these RTs  or just drop them in a text field in the Group Footer1.
IP IP Logged
sv2284
Newbie
Newbie


Joined: 18 Mar 2010
Online Status: Offline
Posts: 17
Quote sv2284 Replybullet Posted: 29 Mar 2010 at 7:50am
That worked. Thank you.
 
could you give me an example of the variable formula also?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Mar 2010 at 8:23am

That is not my cup of tea...Basically you would need a reset variable for the group header, a complex variable formula with a number of imbedded if-then statements per field you wanted to display and the then a final display formula for the group footer.

Perhaps someone else reading will give this a shot as a sample for you?


Edited by DBlank - 29 Mar 2010 at 8:23am
IP IP Logged
sv2284
Newbie
Newbie


Joined: 18 Mar 2010
Online Status: Offline
Posts: 17
Quote sv2284 Replybullet Posted: 29 Mar 2010 at 8:29am
Can anyone help with a variable formula?


Edited by sv2284 - 31 Mar 2010 at 7:30am
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