Skip to Content

Can I print line count in Crystal Report?

Hi Team,

Apologies, and I'll try to explain what is my expected result. I am stuck with what I am doing in my report. Basically, if an order contains 2 lines or more, it sums it up & prints the whole QTY of items. My desired output in printing is, it will just print whichever line I have chosen.

My code is:

WhilePrintingRecords;
NumberVar ItemCount := ItemCount + 1;

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

For example:

The order below contains chair called Buzz, but the order contains 3 lines, since it has different fabric. The total order QTY is 5.

If I print it, the label count shows 1 out of 4. which automatically sums the chair.

My expected output is if I select 1st line, it will just display Buzz 1/2.. and 2/2

Current output displays Buzz 1/4.. 2/4.. 3/4.. 4/4.. even if I just clicked 1st line.

Please help!

buzz.jpg (37.7 kB)
2.jpg (81.2 kB)
3.jpg (25.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 27, 2018 at 06:37 AM

    You're counting on the group of order that's why it's gonna count all 4, try changing the counting criteria to the fabric(which is the only thing different between the lines if i understand correctly.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 28, 2018 at 12:10 AM

    How would I change the counting criteria?

    Is it within the code I have got?

    WhilePrintingRecords;
    NumberVar ItemCount := ItemCount + 1;
    
    ToText(ItemCount, "0") & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0,"")
    Add comment
    10|10000 characters needed characters exceeded