Hi All,
Using Crystal Report Version 8.5.0.217.
I have created a Crystal Report with 3 groups. I have two text object
for a one field. Depends upon number of rows in detail band I want to
hide one text obj. ie. If detail band row count = 1 hide 1st text,
else (>1) hide 2nd text.
I have created three formula fields:
Formula 1: @Reset --> Placed on Header 1 Band
Script
------
WhilePrintingRecords;
booleanVar disp_flg := true;
numberVar Rec_Cnt := 0;
Formula 2: @Detail_Count --> Placed on Detail Band
Script
------
WhilePrintingRecords;
booleanVar disp_flg;
numberVar Rec_Cnt;
Rec_Cnt := Rec_Cnt + 1;
if Rec_Cnt > 1 then
disp_flg := true
else
disp_flg := false;
Formula 3: @Disp_Count
Script
------
WhilePrintingRecords;
booleanVar disp_flg;
Added following two conditional format on suppress of text obj:
text_obj_1: --> On Header 1 Band
Script
------
evaluateafter({@Disp_Count});
if {@Disp_Count} then
false
else
true;
text_obj_2: --> On Header 1 Band
Script
------
evaluateafter({@Disp_Count});
if {@Disp_Count} then
true
else
false;
It works fine when detail record count = 1, displays text_obj_2 in
same group header.
If record count > 1 for group # say: 3rd group, system still displays
text_obj_2 in 3rd group. But 4th group header gets text_obj_1,
eventhoug 4th group record count = 1.
I was trying to work around by placing those two text objects on
Footer 1 Band. It works perfect. I believe text object's formula being
evaluated as soon as 1st row printed in detail band.
Crystal Guru's, is there any work around keeping those two text
objects on Header 1 band.
Thanks in Advance
Using Crystal Report Version 8.5.0.217.
I have created a Crystal Report with 3 groups. I have two text object
for a one field. Depends upon number of rows in detail band I want to
hide one text obj. ie. If detail band row count = 1 hide 1st text,
else (>1) hide 2nd text.
I have created three formula fields:
Formula 1: @Reset --> Placed on Header 1 Band
Script
------
WhilePrintingRecords;
booleanVar disp_flg := true;
numberVar Rec_Cnt := 0;
Formula 2: @Detail_Count --> Placed on Detail Band
Script
------
WhilePrintingRecords;
booleanVar disp_flg;
numberVar Rec_Cnt;
Rec_Cnt := Rec_Cnt + 1;
if Rec_Cnt > 1 then
disp_flg := true
else
disp_flg := false;
Formula 3: @Disp_Count
Script
------
WhilePrintingRecords;
booleanVar disp_flg;
Added following two conditional format on suppress of text obj:
text_obj_1: --> On Header 1 Band
Script
------
evaluateafter({@Disp_Count});
if {@Disp_Count} then
false
else
true;
text_obj_2: --> On Header 1 Band
Script
------
evaluateafter({@Disp_Count});
if {@Disp_Count} then
true
else
false;
It works fine when detail record count = 1, displays text_obj_2 in
same group header.
If record count > 1 for group # say: 3rd group, system still displays
text_obj_2 in 3rd group. But 4th group header gets text_obj_1,
eventhoug 4th group record count = 1.
I was trying to work around by placing those two text objects on
Footer 1 Band. It works perfect. I believe text object's formula being
evaluated as soon as 1st row printed in detail band.
Crystal Guru's, is there any work around keeping those two text
objects on Header 1 band.
Thanks in Advance