Totalscausedby report grouping

mb6606mb6606 Member Posts: 30
For some reason the totalscausedby in the second group footer section refuses to activate. The data is correct
I have tried different keys but still no luck. Any help is appreciated. Thanks

OBJECT Report 50008 Unit Status
{
OBJECT-PROPERTIES
{
Date=07/16/09;
Time=12:06:41 PM;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnPreReport=BEGIN
FilterString := "Item Types".GETFILTERS;
END;

}
DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table50019;
DataItemTableView=SORTING(Code,Group)
WHERE(Group=FILTER(<>''));
ReqFilterFields=Code,Group;
GroupTotalFields=Code;
}
SECTIONS
{
{ PROPERTIES
{
SectionType=Header;
SectionWidth=22500;
SectionHeight=2582;
}
CONTROLS
{
{ 1000000000;TextBox;16467;0 ;1600 ;423 ;HorzAlign=Right;
SourceExpr=FORMAT(TIME,0,0) }
{ 1000000001;TextBox;13316;0 ;3150 ;423 ;HorzAlign=Right;
SourceExpr=FORMAT(TODAY,0,4) }
{ 1000000002;Label ;211 ;0 ;7500 ;423 ;FontSize=9;
FontBold=Yes;
CaptionML=ENU=Unit Status OG 50008 }
{ 1000000003;TextBox;17604;423 ;450 ;423 ;CaptionML=ENU=Page;
SourceExpr=CurrReport.PAGENO }
{ 1000000004;Label ;16722;423 ;750 ;423 ;ParentControl=1000000003 }
{ 1000000005;TextBox;211 ;423 ;7500 ;423 ;FontSize=8;
SourceExpr=COMPANYNAME }
{ 1000000006;TextBox;15804;846 ;2250 ;423 ;HorzAlign=Right;
SourceExpr=USERID }
{ 1000000007;TextBox;1093 ;846 ;7590 ;423 ;SourceExpr=FilterString }
{ 1000000020;Shape ;0 ;1736 ;16325;846 }
{ 1000000014;Label ;12541;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Short Fabric }
{ 1000000013;Label ;10609;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Short Components }
{ 1000000012;Label ;8652 ;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Firm Planned }
{ 1000000011;Label ;6641 ;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=WIP Bandeo }
{ 1000000010;Label ;4683 ;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=WIP Production }
{ 1000000009;Label ;248 ;1736 ;1182 ;846 ;ParentControl=1000000008;
VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes }
{ 1000000021;Label ;14710;1736 ;1262 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=SubTotal }
{ 1000000030;Label ;1641 ;1736 ;1500 ;846 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Description }
}
}
{ PROPERTIES
{
SectionType=GroupFooter;
SectionWidth=22500;
SectionHeight=529;
OnPreSection=BEGIN

CLEAR (remqty);
prod.RESET;
prod.SETCURRENTKEY("Type of Garment","Expected Cut Date","Bandeo Date","Priority Sort");
prod.SETFILTER("Type of Garment",Code);
prod.SETFILTER("Expected Cut Date",'<>%1',121212D);
prod.SETFILTER("Bandeo Date",'<>%1',0D);
IF prod.FIND('-') THEN BEGIN
REPEAT
prodl.RESET;
prodl.SETCURRENTKEY("Prod. Order No.","Size Code","Line No.");
prodl.SETFILTER("Prod. Order No.",prod."No.");
prodl.CALCSUMS(prodl."Remaining Quantity");
remqty:=prodl."Remaining Quantity"+remqty;
UNTIL prod.NEXT=0;
END;

CLEAR (remqty2);
prod.RESET;
prod.SETCURRENTKEY("Type of Garment","Expected Cut Date","Bandeo Date","Priority Sort");
prod.SETFILTER("Type of Garment",Code);
//prod.SETFILTER("Expected Cut Date",'<>%1',121212D);
// prod.SETFILTER("Expected Cut Date",'<>%1|<>%2',0D,121212D);
prod.SETFILTER("Expected Cut Date",'%1..%2',010108D,111112D);
prod.SETFILTER("Bandeo Date",'%1',0D);
IF prod.FIND('-') THEN BEGIN
REPEAT
prodl.RESET;
prodl.SETCURRENTKEY("Prod. Order No.","Size Code","Line No.");
prodl.SETFILTER("Prod. Order No.",prod."No.");
prodl.CALCSUMS(prodl."Remaining Quantity");
remqty2:=prodl."Remaining Quantity"+remqty2;
UNTIL prod.NEXT=0;
END;

CLEAR (remqty3);
prod.RESET;
prod.SETCURRENTKEY("Type of Garment","Expected Cut Date","Bandeo Date","Priority Sort");
prod.SETRANGE(Status,2);
prod.SETFILTER("Type of Garment",Code);
prod.SETFILTER("Expected Cut Date",'%1',121212D);
IF prod.FIND('-') THEN BEGIN
REPEAT
prodl.RESET;
prodl.SETCURRENTKEY("Prod. Order No.","Size Code","Line No.");
prodl.SETFILTER("Prod. Order No.",prod."No.");
prodl.CALCSUMS(prodl."Remaining Quantity");
remqty3:=prodl."Remaining Quantity"+remqty3;
UNTIL prod.NEXT=0;
END;

CLEAR (remqty4);
prod.RESET;
prod.SETCURRENTKEY("Type of Garment","Expected Cut Date","Bandeo Date","Priority Sort");
prod.SETFILTER("Type of Garment",Code);
prod.SETFILTER("Priority Sort",'888888');
IF prod.FIND('-') THEN BEGIN
REPEAT
prodl.RESET;
prodl.SETCURRENTKEY("Prod. Order No.","Size Code","Line No.");
prodl.SETFILTER("Prod. Order No.",prod."No.");
prodl.CALCSUMS(prodl."Remaining Quantity");
remqty4:=prodl."Remaining Quantity"+remqty4;
UNTIL prod.NEXT=0;
END;

CLEAR (remqty5);
prod.RESET;
prod.SETCURRENTKEY("Type of Garment","Expected Cut Date","Bandeo Date","Priority Sort");
prod.SETFILTER("Type of Garment",Code);
prod.SETFILTER("Priority Sort",'999999');
IF prod.FIND('-') THEN BEGIN
REPEAT
prodl.RESET;
prodl.SETCURRENTKEY("Prod. Order No.","Size Code","Line No.");
prodl.SETFILTER("Prod. Order No.",prod."No.");
prodl.CALCSUMS(prodl."Remaining Quantity");
remqty5:=prodl."Remaining Quantity"+remqty5;
UNTIL prod.NEXT=0;
END;

remqty6:=remqty+remqty2+remqty3+remqty4+remqty5;

remqtyt:=remqty+remqtyt;
remqty2t:=remqty2+remqty2t;
remqty3t:=remqty3+remqty3t;
remqty4t:=remqty4+remqty4t;
remqty5t:=remqty5+remqty5t;
remqty6t:=remqty6+remqty6t;
END;

}
CONTROLS
{
{ 1000000022;TextBox;14657;0 ;1500 ;423 ;SourceExpr=remqty6 }
{ 1000000019;TextBox;12673;0 ;1500 ;423 ;SourceExpr=remqty5 }
{ 1000000018;TextBox;10768;0 ;1500 ;423 ;SourceExpr=remqty4 }
{ 1000000017;TextBox;8784 ;0 ;1500 ;423 ;SourceExpr=remqty3 }
{ 1000000016;TextBox;6694 ;0 ;1500 ;423 ;SourceExpr=remqty2 }
{ 1000000015;TextBox;4790 ;0 ;1500 ;423 ;SourceExpr=remqty }
{ 1000000008;TextBox;407 ;0 ;839 ;423 ;SourceExpr=Code }
{ 1000000033;TextBox;1438 ;0 ;3177 ;423 ;SourceExpr=Description }
}
}
{ PROPERTIES
{
SectionType=GroupFooter;
SectionWidth=22500;
SectionHeight=846;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT(FALSE);
IF CurrReport.TOTALSCAUSEDBY = FIELDNO("Item Types".Group) THEN
CurrReport.SHOWOUTPUT(TRUE);
END;

}
CONTROLS
{
{ 1000000037;TextBox;14656;159 ;1500 ;423 ;SourceExpr=remqty6 }
{ 1000000038;TextBox;12672;159 ;1500 ;423 ;SourceExpr=remqty5 }
{ 1000000039;TextBox;10767;159 ;1500 ;423 ;SourceExpr=remqty4 }
{ 1000000040;TextBox;8783 ;159 ;1500 ;423 ;SourceExpr=remqty3 }
{ 1000000041;TextBox;6693 ;159 ;1500 ;423 ;SourceExpr=remqty2 }
{ 1000000042;TextBox;4789 ;159 ;1500 ;423 ;SourceExpr=remqty }
{ 1000000035;TextBox;2276 ;159 ;2321 ;423 ;SourceExpr=Group }
{ 1000000029;Label ;661 ;159 ;1500 ;423 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Totals }
}
}
{ PROPERTIES
{
SectionType=Footer;
SectionWidth=22500;
SectionHeight=846;
}
CONTROLS
{
{ 1000000031;TextBox;14633;0 ;1500 ;423 ;SourceExpr=remqty6t }
{ 1000000027;TextBox;12646;0 ;1500 ;423 ;SourceExpr=remqty5t }
{ 1000000026;TextBox;10793;0 ;1500 ;423 ;SourceExpr=remqty4t }
{ 1000000025;TextBox;8756 ;0 ;1500 ;423 ;SourceExpr=remqty3t }
{ 1000000024;TextBox;6720 ;0 ;1500 ;423 ;SourceExpr=remqty2t }
{ 1000000023;TextBox;4788 ;0 ;1500 ;423 ;SourceExpr=remqtyt }
{ 1000000028;Label ;2462 ;0 ;1500 ;423 ;VertAlign=Bottom;
FontBold=Yes;
MultiLine=Yes;
CaptionML=ENU=Totals }
}
}
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=9020;
Height=3410;
}
CONTROLS
{
}
}
CODE
{
VAR
FilterString@1000000000 : Text[126];
prod@1000000001 : Record 99000791;
prodl@1000000002 : Record 5406;
remqty@1000000003 : Decimal;
remqty2@1000000004 : Decimal;
remqty3@1000000005 : Decimal;
remqty4@1000000006 : Decimal;
remqty5@1000000007 : Decimal;
remqty6@1000000013 : Decimal;
remqtyt@1000000012 : Decimal;
remqty2t@1000000011 : Decimal;
remqty3t@1000000010 : Decimal;
remqty4t@1000000009 : Decimal;
remqty5t@1000000008 : Decimal;
remqty6t@1000000016 : Decimal;
desc@1000000014 : Text[30];
desc2@1000000017 : Text[30];

BEGIN
END.
}
}

Comments

  • asramaboyasramaboy Member Posts: 18
    Hi,

    I think you did not include the "Group" at your "Item Types" DataItem's "GroupTotalFields" properties.

    You got to change it to:

    GroupTotalFields=Group; -or-
    GroupTotalFields=Code,Group;
  • mb6606mb6606 Member Posts: 30
    asramaboy wrote:
    Hi,

    I think you did not include the "Group" at your "Item Types" DataItem's "GroupTotalFields" properties.

    You got to change it to:

    GroupTotalFields=Group; -or-
    GroupTotalFields=Code,Group;

    I have tried this already and instead of breaking on every group it breaks on every line of the first gorup footer. Usually you do not need this in the GroupTotalFields= as other reports work fine without.
  • asramaboyasramaboy Member Posts: 18
    your report got two GroupFooter, are you refer to correct one?

    If you only using one field as your grouping then you not needs to write any code on the GroupFooter - OnPreSection.

    TOTALSCAUSEDBY normally use when you have more then one field to group.

    If you did the change the report should working fine...

    So 1) change the properties to: GroupTotalFields=Group;
      2) Comment or remove your code.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.