Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Printing selective data from the dataset Post Reply Post New Topic
Author Message
Sandy2000
Newbie
Newbie


Joined: 22 Feb 2012
Location: Lithuania
Online Status: Offline
Posts: 3
Quote Sandy2000 Replybullet Topic: Printing selective data from the dataset
    Posted: 18 Apr 2012 at 1:16am
Hi,

I have data table like that
col0 ,      col1,       col2
Key1, value11, value21
Key2, value12, value22

I need to create formulas to display few values for some rows and columns. for example for Key1 and col2 (formula should return value21) or Key2, col1 (returns value12).

I will have to use those formulas in a report footer. formula text looks like:

WhileReadingRecords;
if col0 = 'Key1' then value21

but unfortunately this does not work. Formula outputs the last value. What is the way to get required result?

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Apr 2012 at 3:30am
a footer section will always print the last record's values. If you need to see a prior value in a footer you will need something like shared variables...
 
they tend to come in sets of 3, though for a report footer, you can probably get away with 2:
reset (usually in a group header):
shared stringvar x :=""
 
increment (usually in the detail section)
shared stringvar x;
if some condition then
  x := {table.field};
"" // hide the output
 
display (usually in a group footer):
shared stringvar x;
x
 
HTH
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.048 seconds.