on 04-13-2018 2:37 AM
Hi Team
Basically, I have 2 formula fields in my details section.
I want them to be displayed as a whole number without decimal places.
How can I get rid of the decimal place? Do I have to edit it in a formula and out round () formula?
My formula on the @Details is:
WhilePrintingRecords; NumberVar ItemCount := ItemCount + 1;
My formula on @LineCount is:
WhilePrintingRecords; NumberVar ItemNumber; CStr(ItemNumber, "0") & "/" & CStr(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}))
Please assist.
Never used cstr I always use totext() and that will achieve what you want
ToText(ItemNumber, 0) & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0)
If you numbers are likely to exceed 1000 and you do not want , thousand separator
ToText(ItemNumber, 0,"") & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0,"")
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ian.
Now the issue is the Count of orders PER line item.
I have a set of data in Crystal reports that looks like below: You can see that each item, they have corresponding quantity.
However, there are no suppressed details in the report then the line-number should be equal to RecordNumber. So the following formula I got from you is:
WhilePrintingRecords;
NumberVar ItemNumber;
ToText(ItemNumber, 0) & "/" & ToText(Count({rpt_PackingSlip.LineNo}, {rpt_PackingSlip.WorkOrderNo}),0)
which resulted to:
Notice that it sums all the records in 1 SalesOrder.
But my desired output is:
Abbey should be 1/1
Charlotte should be 1/1
Do you have an idea on what are did I get it wrong?
In your example you have Sales order which is same for both Abbey & charlotte. Is salesorder same as
rpt_PackingSlip.WorkOrderNo
If you want to count on Description you will have to add another group based on Description field, add this below WorkOrderNo Field, suppress header and footer. Change your formula to
ToText(Count({rpt_PackingSlip.LineNo}, {yourdescriptiongroupfield}),0)
Ian
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.