Skip to Content

In Crystal, how to count per line item not per qty in an order?

In Sap Crystal, I am looking for a better option to have the formula to count the # of items per line. (not per workorder)

Example, I have one Work Order# with 2 different items called Eton and Davina.

If I want to print the report, I would like to see that it is counting the # per product not as an order.

My code is:

WhilePrintingRecords; NumberVar ItemCount := ItemCount + 1; `ToText(ItemCount, "0") & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0,"")

Crystal Report Design:

Current Output: Int the below output, it is counting as 1/2 and 2/2, but my desired output should be 1/1 (for Eton) and 1/1 (Davina) because it should be counting per product NOT counting how many items in 1 work order.

capture.jpg (146.1 kB)
3.jpg (157.8 kB)
capture1.jpg (36.9 kB)
capture3.jpg (33.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 08 at 07:54 AM

    Trish

    I am sure you have asked this before, add another group based on Product underneath Work order.

    Change your formula so that this bit

    ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0,"")

    replace this field {rpt_PackingSlip.WorkOrderNo} with your Product Group Field

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • May 09 at 07:13 AM

    You have to create another Group 3 using field Packingslip.itemNo, suppress header and footer as you have done with Groups 1&2

    Ian

    Add comment
    10|10000 characters needed characters exceeded