Print Page | Close Window

Report design between start date & end date

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15034
Printed Date: 20 Apr 2025 at 6:50am


Topic: Report design between start date & end date
Posted By: ronakjmistry
Subject: Report design between start date & end date
Date Posted: 27 Nov 2011 at 6:45pm
Hello Experts,
Right now I am working on crystal report (of Visual Studio 2008) & I am new in crystal report.

In my project,I want to create reports of the employees with their clock In/Out dates & Total hours.

Now, Reports should be display within given start date & end date.(I am easily getting all details using Dataset.)

If user enters start date 7/11/2011 & end date is 16/11/2011 then reports should be display between these two dates like below Phenomenon.

Example:

7/11/2011(Monday) to 12/11/2011 (Sunday) (1st week)
14/11/2011 (Monday) to 16/11/2011 (Wednesday)(2nd week)

And Should be calculate total hours week wise & It may be possible that user may enter any start date & end date.
(like start date 9/11/2011(Wednesday) to end date 16/11/2011(Wednesday))

Crystal report should look like below,

Mr. White   Clock In            Clock out           Hours
--------------------------------------------------------
            7/11/2011 9:30:00   7/11/2011 2:30:00 5:00:0       
            7/11/2011 2:45:00   7/11/2011 3:45:00 1:00:0
            ...........
            ...........
            11/11/2011 5:30:00 11/11/2011 6:30:00 5:00:0
                                    --------------------
                                      Total Hours 39.800

           
           
            14/11/2011 9:45:00 14/11/2011 11:45:0 2:00:0
            14/11/2011 2:30:00 14/11/2011 6:30:00 4:00:0             
            ...........
            ...........
            16/11/2011 9:42:00 16/11/2011 3:42:00 6:00:0
                                    --------------------
                                      Total Hours 23.300              
            ---------------------------------------------   
            Total Working hours : 63.100            



Is it possible or not??

I am waiting for your valuable response.

Thank You,

Ronak Mistry.



Replies:
Posted By: lockwelle
Date Posted: 28 Nov 2011 at 6:21am
well for different layouts I would probably use a flag to 'tell' CR how to display the data, then you could use conditional suppression to hide/display sections so the data is formatted as desired.
 
As for the first issue, you would need to create a formula of some sort that identifies which week each record belongs to based on it's date, but what exactly that would be I don't know as you have business rules that dictate when weeks start and stop and what constitutes a 'random' date range.
 
In pseudo code, the fomula would appear to be something like:
if startDate is monday then
  group value = (record date - start date ) / 7
else
  group value = record date
 
at least top part should work, but again, the actual rules will apply
 
HTH



Print Page | Close Window