cancel
Showing results for 
Search instead for 
Did you mean: 

Record/Line number for item and text lines in two details sections crystal reports

jermainegaza
Participant
0 Kudos

Hi All,

I have a custom invoice layout that I have created and without the stored procedure TmSp_DocLineTypeLayout;1 and used INV10 instead, and added text lines on details b. I managed to get the visual order right but unable to create a line num that works for details a and b. How do I create a linenum that works for both details section.

Kind Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor

I would create a formula like this:

NumberVar rowNum;
If OnFirstRecord or {Invoice Number Field} <> Previous({Invoice Number Field}) then
  rowNum := 0;
rowNum := rowNum + 1;
Right('000' + toText(rowNum, 0, ''), 3)

Put the formula in each of the details sections where you want to display the row number.

-Dell

jermainegaza
Participant
0 Kudos

Hi Dell,

Thank you for your response. See below error message when I try to add this formula.

DellSC
Active Contributor
0 Kudos

Sorry about that! I forgot the "then" at the end of the If statement. I have fixed it in the formula above.

-Dell

jermainegaza
Participant
0 Kudos

Thank you Dell. May I confirm on "{Invoice Number Field}", is this the INV1.linenum field? I have used that and the results are as below.

DellSC
Active Contributor
0 Kudos

Hmmmm.... That should work. Try adding "WhilePrintingRecords;" to the top of the formula and see whether that will help.

-Dell