Skip to Content
0
May 07, 2018 at 09:45 PM

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

148 Views

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.

Attachments

capture.jpg (146.1 kB)
3.jpg (157.8 kB)
capture1.jpg (36.9 kB)
capture3.jpg (33.2 kB)