KB: Add line number to a BOM template

Altium Designer Altium Designer
Starting in version: 18 Up to Current

How to format BOM template column to include line # (line number). Unable to add Line # using the Column=Line Number Format in a BOM Template

Solution Details

The native way is to use an ActiveBOM and add the line numbers in the BomDoc. Reference: https://www.altium.com/documentation/altium-designer/activebom-bom-management#!line-number-column

The Column declaration in the Excel template is replaced by the ColumnName string, with each row below being populated by that column value for each BOM Item.

Columns are used in the format:

Column=ColumnName

An example would be Column=Designator. 
In order to include Line #'s from the Active BOM  in a BOM template, the format is Column=Line #


image
The ActiveBOM can add automatically populate the Line #'s for you, first you will want to make sure the Line # column is enabled in the Properties >> Columns tab of the ActiveBOM document. Once enabled, near the top of the BomDoc click the "Set Line Numbers" button to automatically create the line numbers for the components. If you are trying to define this in the Excel template itself, you would need to create a new column and In the first few fields in the column set the value to =Row() to create the line numbers.

"Click the Set line numbers button (Set Line Numbers button, click the arrow to configure line numbering) in the Base view to add a line number to each row. Click the dropdown icon on the right of the button to open the Line # Options dialog, where the start and increment values can be defined. Refer to the Line Number Column section to learn more."

Reference:
https://www.altium.com/documentation/altium-designer/activebom-bom-management#!the-bom-items-list

Here is additional documentation that may be of interest:
https://www.altium.com/documentation/altium-designer/bom-configuration-in-the-report-manager-ad#!mapping-design-data-into-the-bom

Here's a list of pre-defined special strings:
https://www.altium.com/documentation/altium-designer/pcb-obj-stringstring-ad#!pcb-predefined-special-strings

Here's information on User-Defined project parameters:

https://www.altium.com/documentation/altium-designer/workspacemanager-dlg-projectpropertiesdialog-pagecontrol-main-parametersproject-options-parameters-ad

If you want to turn on/off columns, it can be done in the Properties panel.
Columns.png

You would also need to configure the start number as well as the incrementation:
https://www.altium.com/documentation/altium-designer/activebom-dlg-linenumberoptionsdialogline-number-options-ad

If you opt to not include ActiveBOM in your project, this system-reserved parameter 'Line #' (introduced first when ActiveBom was introduced) does not show up as one of available parameters above.

For the non-interactive way, you will have to use an excel template. You can simply add a new column titled line number for example then enter the formula: =ROW() into each field. It will then populate the number in the following rows as it is generated. Configure the outjob to point to that template.
Reference:
https://www.altium.com/documentation/altium-designer/including-design-data-excel-format-bom

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.