Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoid counting Line.Text with RecordNumber line numbers

Status
Not open for further replies.

octaviz

Technical User
Apr 30, 2021
3
ES
Hello everyone, I have a Crystal Report document that is an Order and below the product lines sometimes a simple line of text is added below that is linked to the one above, I wanted to know if it is possible that the RecordNumber field that count the lines avoid counting when there is a line of text and only count the products.

this is how it comes out right now
1 CODE DESCRIPTION PRICE
2 TEXT.LINE
3 CODE DESCRIPTION PRICE
4 CODE DESCRIPTION PRICE
5 CODE DESCRIPTION PRICE
6 TEXT.LINE
7 CODE DESCRIPTION PRICE

this is how i want it to appear
1 CODE DESCRIPTION PRICE
TEXT.LINE
2 CODE DESCRIPTION PRICE
3 CODE DESCRIPTION PRICE
4 CODE DESCRIPTION PRICE
TEXT.LINE
5 CODE DESCRIPTION PRICE

I do not know if it is possible with a formula, I have the RecordNumber field in the 2 lines, both in the products and in the Line.Text
If I put it only in the row of products it counts me then Odd

screen_yfdlai.png


Thanks!
 
Rather than use RecordNumber, I'd suggest you use a Running Total. Set it up to Count any of the report fields and Evaluate on formula.

As for the formula, it is a little difficult to be specific based on the screen shot provided, and will depend whether the second report column (I've called it {Table.2ndColumnField} in the formula below) is Null or an empty string, but it would look something like this:

[Code {@RecordCount}]
Not IsNull({Table.2ndColumnField}) or
Trim({Table.2ndColumnField} <> '')
[/Code]

Hope this helps.

Cheers, Pete
 
Hi, Thanks for your answer, what I don't understand is using 'Running Total', how you can use this option. On the other hand, I am attaching a capture of the rpt so that you can see how I have it configured. I have the RecordNumber in each row Detail a and d, and what I want is not to count the one in TXT.LineText, this document is printed in SAP B1 9.3, the version I use of Crystal Reports is 2016 14.2

Screenshot_2_b2r6ov.png
 
When you set up the running total, I think you can just do a distinctcount of item number, evaluate on change of item number (no formula necessary), and place the running total only in the details_a section. If you want the count to reset within a certain group, then in the running total, add a reset on change of that group.

-LB
 
Very thanks lbass, I have already managed to make the line counter group the 2, in the end I have used "Group Header" to put the 2 lines in the same group.

Greetings from Barcelona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top