Thanx for your reply. Now the next problem is when i preview the report its taking long until i cancels it. Am not sure if it will present some details or not.
Here are the codes and how i designed it for you to look at and share the solution with me please.I would really appreciate yr help.
One (1) data item = Gen. Business Posting Group
Global Variables =
Name DataType Subtype Length
InventoryPGrp Record Inventory Posting Group
GenFilters Text 300
GenBusiPostingGroupAmt Decimal
GenBusiPostingGroupTotals Decimal
InvPostingGrpAmount Decimal
InvPostingGrpTotals Decimal
valueEntry Record Value Entry
Idx Integer
SalesDateFilter Date
SalesDateFilter1 Date
Local Variable =
Name DataType Subtype Length
Jx Integer
Inventory P Group Record Inventory Posting Group
Report - OnPreReport()
GenFilters := “Gen. Business Posting Group”.GETFILTERS;
//Get Inventory Posting Groups
Jx := 1;
IF NOT “Inventory P Group”.FIND (’-’) THEN
ERROR (‘No Inventory Posting Groups are defined’);
REPEAT
InventoryPGrp[Jx]:= “Inventory P Group”;
Jx += 1;
UNTIL “Inventory P Group”.NEXT = 0;
}
IF Item.GETFILTER (“Date Filter”) = ‘’ THEN
ERROR (‘Please specify Date Filter’);
FromDate := Item.GETRANGEMIN (“Date Filter”);
ToDate := Item.GETRANGEMAX (“Date Filter”);
{
Gen. Business Posting Group - OnAfterGetRecord()
InvPostingGrpTotals := 0;
GenBusiPostingGroupTotals := 0;
valueEntry.RESET;
valueEntry.SETCURRENTKEY(“Item Ledger Entry Type”,“Gen. Bus. Posting Group”,“Inventory Posting Group”,“Posting Date”);
valueEntry.SETFILTER(valueEntry.“Item Ledger Entry Type”,‘Sale’);
valueEntry.SETFILTER(valueEntry.“Gen. Bus. Posting Group”,“Gen. Business Posting Group”.Code);
Idx := 1;
REPEAT
GenBusiPostingGroupAmt[Idx] := 0;
valueEntry.SETFILTER(valueEntry.“Inventory Posting Group”,InventoryPGrp[Idx].Code);
valueEntry.SETRANGE(valueEntry.“Posting Date”,SalesDateFilter,SalesDateFilter1);
IF valueEntry.FIND(’-’) THEN
REPEAT
GenBusiPostingGroupAmt[Idx] += valueEntry.“Sales Amount (Actual)”;
UNTIL valueEntry.NEXT = 0;
GenBusiPostingGroupTotals += GenBusiPostingGroupAmt[Idx];
InvPostingGrpTotals += GenBusiPostingGroupAmt[Idx];
UNTIL InventoryPGrp[Idx].Code = ‘’;
IF GenBusiPostingGroupTotals = 0 THEN
CurrReport.SKIP;
NB: when i comment codes for Gen. Business Posting Group - OnAfterGetRecord() , the Headers are well displayed.