In the past, some of our customers have asked how to add a reference number to each line on their reports. While this can be done manually using a custom field, if you are looking for an automated way to generate a counter next to each line item, please review the instructions on this blog.
This is likely one of the most simple customization requests as all you need to do is add 3 lines of code and 1 text box:
Please note, this instruction is intended for SI users with experience on customizing reports, and some of the elementary steps are omitted.
On the Designer side, add a text box “txtCount” next (or before) each item, as shown below:
You can also add the header on the GrpHeader as shown below:
On the Script side:
1- Go to the desired group/detail section (usually Sub grpItemHeader_Format)
2- Add the following code:
txtCount.Value = count
count = count + 1
3- Declare a private count on the “Imports” section, all the way on the top of the report:
private count as integer = 1
This is what the report code would look like:
This is it!
Should you need any further assistance, please contact us at firstname.lastname@example.org