Sales Price Report, group by Item No & UoM

amphysvenaamphysvena Member Posts: 113
Hi,
I try to make a simple report. Only using 1 data item Sales Price. set tableview using the first key : Item No.,Sales Type,Sales Code,Starting Date,Currency Code,Variant Code,Unit of Measure Code,Minimum Quantity.

Set the GroupTotalFields : Item No.,Unit of Measure Code.
Create two GroupHeader, GroupHeader(1) & GroupHeader(2).

GroupHeader(1) to show item no. On PreSection put this code :
CurrReport.SHOWOUTPUT(CurrReport.TOTALSCAUSEDBY = FIELDNO("Item No."));

GroupHeader(2) to show Unit of Measure COde. On PreSection put this code :
CurrReport.SHOWOUTPUT(CurrReport.TOTALSCAUSEDBY = FIELDNO("Unit of Measure Code"));

Then on Sales Price Body, shows the Sales Code (Customer Code in my database)

I'm expecting the report will show like this:
ITEM1
======================
KG
CUST1
CUST2

PCS
CUST3

But instead, the report shows like this:
ITEM1
======================
KG
CUST1

KG
CUST2

PCS
CUST3

Any mistake on my code? thanks

Regards,
Alphonse

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi,

    What is the problem with the report?

    I suspect that the break on the item is ok but not the UOM. This is because of the key as it is sorting by item (this is ok) then a number of fields eg starting date then UOM. So from you example you have two item "KG" and on "PCS" - if the "PCS" has a starting date between the two "KG" item then you will get three breaks.

    You will need to create a key with Item no.,UOM.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • amphysvenaamphysvena Member Posts: 113
    OK, So the key between Item No. & Unit of measure code, effecting the break.
    It is solve the problem if I create new key (Item No., Unit of measure code).

    I always thought it only effected by the sequence in the key selected. So no need to create new key.
    Thanks for the reply Dave.
  • DaveTDaveT Member Posts: 1,039
    Glad to Help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.