Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Complex Design Post Reply Post New Topic
Author Message
hannankhanji
Newbie
Newbie
Avatar

Joined: 23 Oct 2008
Location: Kuwait
Online Status: Offline
Posts: 2
Quote hannankhanji Replybullet Topic: Complex Design
    Posted: 23 Oct 2008 at 12:39am
Dear All,
I have complex report design,n iam stuck at some point.
let me explain:
I have a requirement to make a report for continuous absent for more then 7 days or more for an employee in a given period.i have the table which gives me employee daily attendlog from which i can select record when he is absent, and  i want to display them if the count is more then 7 n they are continuous.
so i want some mechanism where i can check that absentdate in current row and previous row has one day difference,if it is one day diff then increasre the variable otherwise reset the counter..i could partially achieve this using running total ,now i am having records with runningtotal greater then 7,but i want to show summary maximum runningtotal value,and suppress other records.
i hope i could explain the accept. pls suggest some better way if possible.


Edited by hannankhanji - 23 Oct 2008 at 12:50am
hhk999
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 23 Oct 2008 at 6:11am
you can do in this way. 
1. group the records on employee id.
2. sort the records in employee id, attendance date  order
3. create a formula "initval" to declare a shared variable syntax as follows
    shared stringvar absrec :="";
4. place this initval in group header of employee id so it initalized to blank for every employee id
5. create one more formula "checkabs" to check continous absentiee for
    more than 7 days. formula has following syntax
     if datediff("d",previous(<datefield>),<datefield>) >= 7
            and
        previous(<empidfield> = <empidfield>) then
          shared stringvar absrec := "A";

6. Now store the value of this share variable in one more formula "abs" having    folowing sytnax
     shared stringvar absrec;
7. so if any employee is absent for 7 days the value of "abs" will be "A".
8. now you can supress the employee group id footer based on the values of "abs".
   i.e conditional supressing  syntax
    abs <> "A".
Let me know if you get any error.
Thanks
Savan
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.031 seconds.