Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Subreport Preview Post Reply Post New Topic
<< Prev Page  of 4 Next >>
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Apr 2015 at 6:13am
how are you limiting the data to the one mont in the main report?
parameter? lastfullmonth?
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 21 Apr 2015 at 6:15am
Currently 'MonthtoDate' - I've made it a little easier on myself at the moment by applying the same condition to the subreport (so I don't have to worry about passing that through, yet)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Apr 2015 at 6:22am
in the subreport create a formula to get the year week value (same as in your main report for the grouping)
//sr_weekofyear
datepart('ww',table.datefield)
in the main right click on the subreport and select links
select the @weekofyear field form the main report and link it to the @sr_weekofyear from the subreport
 
In the subreport this will appear as a part of the select statement
your overall select statement will be identical for all 7 subreports except that you will change which weekday value to limit
 


Edited by DBlank - 21 Apr 2015 at 6:23am
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 21 Apr 2015 at 10:37pm
Thank you :-)

The 'SUM' display numbers now look a lot better but, strangely, aren't completely accurate... Taking the current month (as MTD) we have 4 Sundays:

Week 14 - Hyperlink Display: 0 - Subreport records: 0

Week 15 - Hyperlink Display: 292 - Subreport records: 276

Week 16 - Hyperlink Display: 52 - Subreport records: 49

Week 17 - Hyperlink Display 48 - Subreport records: 45

As you can see they are all out by a bit.... Strange!! I tried using 'Count' instead of 'Sum' but that made the numbers huge (I assume because it was counting the 0's as well as the 1's). I'll keep looking into what's happening...

My next question is if it is possible to have the 'Day' of the month on the boxes as well. For example, for this month, the Sundays would be 05th, 12th, 19th, 26th...?
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 21 Apr 2015 at 10:57pm
I've figured out the difference in numbers - because I am using two different tables (one with the date in); because I hadn't included the entries in the report it was counting without limiting....

The only thing left is if I can get the days on the squares then it will be perfect :D
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2015 at 3:52am
How do you want it displayed?
Just the number of the day of the month or something else?
IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 22 Apr 2015 at 4:03am
yeah the number is fine - just something to represent the date (not just the day). 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2015 at 4:05am

do you ever have days with 0 records?

IP IP Logged
Dr4ke
Senior Member
Senior Member


Joined: 09 May 2014
Online Status: Offline
Posts: 209
Quote Dr4ke Replybullet Posted: 22 Apr 2015 at 4:07am
unfortunately, yes. I was going to link the report to an Excel file so I can capture all of the dates, regardless of counts. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2015 at 4:52am
do you have a "calendar table" you can join into the mix?
IP IP Logged
<< Prev Page  of 4 Next >>
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.