Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I am so glad that I found your site, it is an excellent resource and has helped me greatly..."

Geography

Where in the world do Tek-Tips members come from?
atarrqis (IS/IT--Management)
11 Jul 12 14:32
CR11 and Oracle
Main report has 2 groups
1 = part_no
2 = dept
Subreport has no groups, linked by part_no and dept., sums std_hrs
Subreport formula in Subreport Report Footer called stdhrs:
WhilePrintingRecords;
Shared NumberVar SH := Sum ({PRS.STD_HRS});

Subreport formula in Subreport Report Header called stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar SH := 0;

Subreport is in main section 2a footer

Main formula in section 2b footer called main_stdhrs:
WhilePrintingRecords;
Shared NumberVar SH;
Shared NumberVar MSH := MSH + SH;

Main formula in section 1 header called main_stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar MSH :=0;

This works ok but some part_no/dept have no std_hrs.
It seems when this is true SH keeps the previous value so my total (MSH) is too high.
hilfy ( IS/IT--Management)
11 Jul 12 16:17
In the same formula where you're resetting the value on MSH, you also need to reset the value on SH. Yes, you need to do this even though you're defaulting to 0 in the subreport.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

atarrqis (IS/IT--Management)
11 Jul 12 16:48
Ok I did that but it didn't make any difference.
whileprintingrecords;
Shared NumberVar SH :=0;
shared numbervar MSH :=0;

It still double counts the previous record when the subreport is null.
hilfy ( IS/IT--Management)
11 Jul 12 18:10
OK, try putting something like the following in the formula in the subreport:

WhilePrintingRecords;
Shared NumberVar SH := 0;
If not IsNull(Sum ({PRS.STD_HRS})) then SH := Sum ({PRS.STD_HRS});

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

atarrqis (IS/IT--Management)
11 Jul 12 19:28
No, still no change. I think it doesn't run the subreport when there is no match to dept. so it doesn't touch SH.
IanWaterman (Programmer)
12 Jul 12 3:54
Place your SH reset formual in Dept group footer.

WhilePrintingRecords;
Shared NumberVar SH := 0;

That way it will always be reset even if no data in SR

Ian
atarrqis (IS/IT--Management)
12 Jul 12 11:20
That worked but thought I had tried that previously. Thanks.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close