Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crosstab Date Column Post Reply Post New Topic
Author Message
chris.wolf
Newbie
Newbie
Avatar

Joined: 01 Apr 2011
Online Status: Offline
Posts: 9
Quote chris.wolf Replybullet Topic: Crosstab Date Column
    Posted: 28 Sep 2016 at 5:37am
I am trying to setup a crosstab report that shows a value by the date of the week.
I want to set the days of the week so that the columns are all the same number for each group.
What formula do I need to use to set the daily columns from 1st of the month to the last day of the month?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 03 Oct 2016 at 6:01am
First off, you must have all of the dates you want in your report available in the database. If they're not in the database, there's no way to to show them all on the report.

I usually do this with a "Calendar" table, that has all of the dates, an indicator on whether the date is a weekend, and a few other pieces of information. I then make the calendar table the "master" table for the report and left join from it to a date field in the data (or to a SQL expression that will truncate the time off of the date field).

You then use the date field from the calendar table when you want to show the date - because of the left join, it will show all of the dates in the selected time period.

In the Cross-Tab you use the date field from the calendar table as the columns. I think that initially this will show one date for every week. Once the cross-tab is set up, right-click on the date field in it and select "Column Options" and then "Group Options". Set "This column will be printed" to "for each day" to get all of the days.

-Dell
IP IP Logged
chris.wolf
Newbie
Newbie
Avatar

Joined: 01 Apr 2011
Online Status: Offline
Posts: 9
Quote chris.wolf Replybullet Posted: 03 Oct 2016 at 10:05pm
Hi Thanks for the advise. I have managed to do the week name using this formula in the group options -

'Week ' & Totext(Datepart("ww",{SOPOrderReturn.DocumentDate})+1 - Datepart("ww",{SOPOrderReturn.DocumentDate} - Day({SOPOrderReturn.DocumentDate})+1), 0)
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.