Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Calander Style Report Post Reply Post New Topic
Author Message
Lord Yorkshire
Newbie
Newbie
Avatar

Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Quote Lord Yorkshire Replybullet Topic: Calander Style Report
     Posted: 07 Dec 2011 at 6:20am
I want to report on things that happen during the month. To start with, I would like to run a report and whatever the current month is, the report would show the days for that month. So now it it would look like this
 
Thursday 1st Dec
Friday 2nd Dec
Saturday 3rd Dec
Sunday 4th Dec
Monday 5th Dec
Tuesday 6th Dec
etc etc
 
The only data will be the date, so that is the key driver.
 
Seems like it should be simple but i've not a found a way of doing this.
 
Any help would be appreiciated.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Dec 2011 at 7:47am
you need a source (table, stored proc, etc.) that has 1 row per calendar date.
you can then filter that using today's date
 
you can write 31 formulas to that dynamically change tha value and insert them onto 31 sections that you hide suppress
//for day1
date(year(currentdate),month(currentdate),1)
//for day 2
if day(currentdate)<3 then date(year(currentdate),month(currentdate),2)
//for day 3
if day(currentdate)<4 then date(year(currentdate),month(currentdate),3)
etc.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Dec 2011 at 3:26am
couldn't use the date source and then outer join your data.
then in report/selection formulas/record have something like:
month({table.field}) = month(currentDate)
and
year({table.field}) = year(currentDate)
 
in thinking about it, the {table.year} could be the source file.
 
Seems like Lord Yorkshire is looking for each day of the month to be listed and all events that occurred to be displayed, just that when nothing happened the date is still displayed.
 
I guess I am confused by the 31 formulas...their purpose.
 
Seems like
IP IP Logged
Lord Yorkshire
Newbie
Newbie
Avatar

Joined: 04 Jul 2010
Online Status: Offline
Posts: 28
Quote Lord Yorkshire Replybullet Posted: 08 Dec 2011 at 3:33am
Originally posted by lockwelle

Seems like Lord Yorkshire is looking for each day of the month to be listed and all events that occurred to be displayed, just that when nothing happened the date is still displayed.
  
 
that is exactly right.
 
p.s only been doing Crystal for a couple of years as a part time thing, so i'm not highly skilled.


Edited by Lord Yorkshire - 08 Dec 2011 at 3:39am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Dec 2011 at 3:59am
sorry for any confusion...to explain I read the below part as possibly just wanting to show a calender. That was the purpose of the 31 formulas as a work around with no source table.
 
To start with, I would like to run a report and whatever the current month is, the report would show the days for that month. So now it it would look like this ...
 
Given that there is a source of events that must be included, I agree that having a source of the full calendar days and doing an outer join is the simplest way.
 
You can also use formulas and multiple detail sections to fill in the blanks (missing dates).
Not my forte, but the concept is
check if any rows exist, if not run a While Do to create all dates for the month to today in the formula.
if one does exist and <> first day of the month use while-do to create all dates fom first of the month to one day less than row date.
next row check previous row to see if it = current row or datediff in days is >1 then use the while-do here.
repeat
on last record check if it is=today, if not use while do to insert text for missing records at the end


Edited by DBlank - 08 Dec 2011 at 4:01am
IP IP Logged
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