Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress section help needed Post Reply Post New Topic
Author Message
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Topic: Suppress section help needed
    Posted: 05 Nov 2012 at 10:57am

Hi,

I have a report calculating consecutive sick time.  If sick time has been coded more than once in 21 days, I flag the row on the report.

The report may look as follow

 

Employee ID      Name               Date Worked     Consecutive Sick Time

100                         John Doe          2012/08/13

200                         Jim Test            2012/09/21

300                         Jane Test2       2012/10/13

300                         Jane Test2       2012/11/01         **

400                         John Test3       2012/09/29

400                         John Test3       2012/10/28

500                         Jane Test4       2012/09/16

500                         Jane Test4       2012/09/25         **

 

I’d like to change the report to only print employees who have been flagged as follow

 

Employee ID      Name               Date Worked     Consecutive Sick Time

300                         Jane Test2       2012/10/13

300                         Jane Test2       2012/11/01         **

500                         Jane Test4       2012/09/16

500                         Jane Test4       2012/09/25         **

 

I set up suppress detail section formula

 

Next({HRIS_SNI_SICK_TCODE1.LHS_WB_EMP_NAME}) <> {HRIS_SNI_SICK_TCODE1.LHS_WB_EMP_NAME} and

{@Consecutive_Sick} = " "

 

It doesn’t work, I can only suppress where {@Consecutive_Sick} = " " and I lose ie.

 

Employee ID      Name               Date Worked     Consecutive Sick Time

300                         Jane Test2       2012/10/13

 

Is there a way to do it ? Thanks in advance.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 05 Nov 2012 at 6:20pm
Hi
 
--Create a group on Employee ID
--Insert a summary on on Consecutive Sick Time (Maximum) and place the summary on group header
 
--Go in Report Menu --Group--then give the following condition :
 
Maximum({@Consecutive_Sick},{Employee ID} = "**"   
 
--Suppress Group header and group footer.
Thanks,
Sastry
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 06 Nov 2012 at 3:02am
Thanks, {@Consecutive_Sick} is a formula and I cannot insert Summary for this field. I would also like to print all rows for an employee if one of the rows contains '**'.

Edited by Zuzanna - 06 Nov 2012 at 3:04am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2012 at 3:48am
can you use a stored procedure or some other source to get your data set here? I assume you are creating your "Consecutive sick" by using a next() or previous() function which will preclude you from being able to conditionally supress rows in the group that occurred prior to the row thjat "finds any consecutive day".

Edited by DBlank - 06 Nov 2012 at 3:49am
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 06 Nov 2012 at 4:47am
Hi,
 
this is my {@Consecutive_Sick}  formula
 
If not PreviousIsNull({HRIS_SNI_SICK_TCODE1.LHS_WB_EMP_NAME}) Then
   If Previous({HRIS_SNI_SICK_TCODE1.LHS_WB_EMP_NAME}) = {HRIS_SNI_SICK_TCODE1.LHS_WB_EMP_NAME} Then  //not first record     
      If DateDiff("d", previous({HRIS_SNI_SICK_TCODE1.LHS_WB_WORK_DATE}), {HRIS_SNI_SICK_TCODE1.LHS_WB_WORK_DATE}) <= 21 Then
         "**"
      Else
         " "
   Else
       " "
Else
     " "
It works ok to flag the rows, but if I suppress the detail section where
 
 
I also suppress the first row of my group that has blank in the flag and  contains the '**' flag. It would be nice to see it because it shows the first work date marked with Sick Time.
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2012 at 5:29am
your formula is about what I would have expected.
The problem you are going to have is how crystal does things in data asses. You have to calculate this formula in such a late pass that you cannot use the result (not being able to summarize it) to suppress eiterha group or a row that is printed above the result.
This si why I was suggesting tio try and get your result in your source via a command or a stored proc.
Are either of these available to you?
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 06 Nov 2012 at 6:01am
I have never used either. We're on Oracle database and I pass data to crystal through PeopleSoft query.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2012 at 8:21am
The only thing I can think of would be to use sub report at the group header
I hate to use them if you can avoid them as they can really bog performance down but...
put a sub report in the group header 1A (linking on employee id),
use it check to see if the group meets the condition as a whole
return a shared variable of True / False or Yes/No in a GH1B
use this to suppress/show GH1C and details section which is what you have now.
 
You can suppress all of the fields in the sub report,
conditionally suppress the sub report when blank and then suppress group header1 when blank
you cannot suppress the sub report striaght out or it will not run


Edited by DBlank - 06 Nov 2012 at 8:49am
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 06 Nov 2012 at 8:45am
Oh boy, I'll try. Thanks for your help.
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.047 seconds.