Link to home
Start Free TrialLog in
Avatar of ebrandel
ebrandel

asked on

Custom Crystal Reports 30 minute groups - offset by -10 minutes

I have a report that displays some average, minimum, and maximum data for a number of different sensors. The report is supposed to display a days worth of data, grouped by 30 minutes. I'm having two issues with it:

First, the data needs to be grouped in an abnormal fashion. Specifically, the groups are for 30 minutes, but offset by 10 minutes. So, if the day to be displayed was 03/28/2006, the groups would be:

03/27/2006 23:50 - 03/28/2006 00:19
03/28/2006 00:20 - 03/28/2006 00:49
03/28/2006 00:50 - 03/28/2006 01:19
...
03/28/2006 22:20 - 03/28/2006 22:49
03/28/2006 22:50 - 03/28/2006 23:19
03/28/2006 23:20 - 03/28/2006 23:49


Second, the layout. The layout that the customers would like is as follows:

Group 1 | Group 2
Group 3 | Group 4

So, four groups per page with a total of 12 pages per report. This is much less important than the grouping and if it's difficult or can't be done then the layout would just have to be:

Group 1
Group 2
Group 3
Group 4

for each page.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ebrandel
ebrandel

ASKER

Well, I've taken a slightly different approach now: I'm using subreports.

Basically the subreport will have one group in it, and then I'll use formulas to separate the data out into two sections. On the main report I'll simply have it group a timestamp by hour and then have the subreport in the detail section (so it will print out twenty four of the subreports).

So the page will be like so:

Subreport 1: "Group" 1 | Subreport 1: "Group" 2
Subreport 2: "Group" 3 | Subreport 1: "Group" 4

I put "s around Group because they're not real groups. I'm using a setup similar to the one shown at http://support.businessobjects.com/library/kbase/articles/c2006365.asp to gather the data and using a formula like your grouping one to separate the date out.

My code to grab data from the db is something like this:

if minute({TABLE.SENSOR_TIME}) >= 50 OR minute({TABLE.SENSOR_TIME}) <= 19 THEN
    rhtotal_left = rhtotal_left + {TABLE.RH_INS}

    if {TABLE.RH_INS} > rhmax_left then
        rhmax_left = {TABLE.RH_INS}
    end if

    if {TABLE.RH_INS} < rhmin_left then
        rhmin_left = {TABLE.RH_INS}
    end if
else
    rhtotal_right = rhtotal_right + {TABLE.RH_INS}

    if {TABLE.RH_INS} > rhmax_right then
        rhmax_right = {TABLE.RH_INS}
    end if

    if {TABLE.RH_INS} < rhmin_right then
        rhmin_right = {TABLE.RH_INS}
    end if
end if


Not that it would have helped me, but I'm really suprised their isn't a 30 minute grouping available in Crystal Reports.

Anyways, thanks for your help. Your formula really helped me.
oops...

"Subreport 2: "Group" 3 | Subreport 1: "Group" 4" should read
"Subreport 2: "Group" 3 | Subreport 2: "Group" 4"
Good solution

Glad i could help

mlmcc