Document number | Revision |
---|---|
DOCU14825 | 1 |
<feature name="export"> Element - Schema ReferenceDefinitionElementsOverviewDetailsfeature
/profile
feature
/profile
/type
feature
/profile
/type
/column
feature
/profile
/report
feature
/profile
/report
/resource
feature
/profile
/attachment
Report generatorsStandard report formatsGuides and SamplesStandard export profile definitionUsing default report generatorsAboutCreating and using custom report generatorsTemplatesInstructions
The BOM Export feature allows you to create multiple export profiles, each defining the contents and permissions for users when generating detailed reports and exporting data and files from Highstage.
Overview of the elements and attributes that are associated with the <feature name="export"/>
element.
Element | About |
---|---|
feature /profile | Defines a single unique export profile |
feature /profile /type | Explicit data and file configuration for objects of a specific type. |
feature /profile /type /column | Configuration of specific data columns. |
feature /profile /report | Defines which reports to generate when exporting. |
feature /profile /report /resource | Object containing files for specific reports (may be required by certain report elements). |
feature /profile /attachment | Include files from unrelated objects in the export as attachments. |
Details on each element's purpose, function, and attributes.
feature
/profile
Each profile element (with a unique name) will be available for users to choose from when exporting objects of that type.
Attribute | Type | Mandatory/Optional | Fallback value (if undefined) | Description |
---|---|---|---|---|
name | String | Mandatory | N/A | Unique element name. |
included-types | Type (list) | Optional | * (all available types) | list of available base- and subtypes (semicolon separated (; ). Objects of listed types will be available for export. |
excluded-types | Type (list) | Optional | Empty list (nothing is excluded) | List of available base and subtypes (semicolon-separated ; ). Objects of these types cannot be exported, overriding the included-types attribute. |
regex-file-pattern | Regex | Optional | ^[^~].* (Include all files except those starting with ~ .) | A regular expression (regex) that specifies the files available for export applying to all objects. |
filename | String | Mandatory | N/A | Define the package folder name (Use datetime runtime variables to avoid file name collisions. The export will not overwrite existing files; it will fail if a duplicate already exists). |
foldername | String | Optional | ~exports | Creates a dedicated folder, from the export object, for the export packages. You can set unique write permissions on this folder to let users manage past exports. |
export-roles | Vector roles (list) | Mandatory | N/A | List of vector roles (semicolon-separated ; ) allowed to use export with the selected profile. |
enforce-security | Boolean | Optional | true | ⚠️ Overrules default access security, if specified and set to false Decide if user-specific security and permissions should be applied ( true ) or disabled (false ) for the exported contents. This controls whether users can export data and files they are not allowed to view. |
feature
/profile
/type
The <type>
element is optional, but it gives you control over what data columns are exported for each object type.
Use the <type>
element when you want to customize what data is shown and exported — for example, if the default reference view in Highstage doesn't match what you want to export for any specific object type in your BOM.
You can, for any type:
Use an existing grid, and/or;
Define your own data columns to preview and export.
Note: If you want to include reference columns, then you have to define a grid.
If no <type>
element is defined:
The system will automatically use the default grid linked to that object type.
The exported data will match what is shown in the reference sections.
This default grid uses the ref-columns
attribute to decide which columns to show.
Important merging data across types using titles If two or more data columns have the same title, across types, they will be combined into a single column in the preview and reports. This helps consolidate related information across different types.
Defining a type without content? If a
<type>
is defined without any defined<column>
elements norgrid
attribute, then we only preview and export thelevel
andobject
columns.Example:
1<profile name="simple">
2<type name="doc"></type>
3</profile>
If your export profile includes a
<type>
element but does not define agrid
or any<column>
elements, only the following data will be shown in the preview and export for any documents in the BOM:
level
– the document’s placement in the BOM
Object
– the document's object nameNo other data will be included unless you explicitly define it.
Attribute | Type | Mandatory/Optional | Fallback value (if undefined) | Description |
---|---|---|---|---|
name | String | Mandatory | N/A | The name of the object type (either a base- or subtype) that you wish to configure. This includes specifying which grid and/or columns to display and export. |
grid | Grid | Optional | N/A | Define a grid (must be a grid that's available on the type defined in the name attribute). The data columns associated with the selected grid will be displayed and exported for objects of that type including their listed order.Supported Data Columns: Only physical data columns and virtual columns that have an sqlselect or column attribute will be available for export.Data Column Titles: By default, we use the titles defined for each data column. If no title is specified, the name of the data column will be used instead (can be overruled for each data column using the column element). |
regex-file-pattern | Regex | Optional | If not defined, default to regex-file-pattern from profile definition. | A regular expression (regex) that defines the files available for export for objects of this type. This expression overrides the regex-file-pattern specified in the profile element. |
feature
/profile
/type
/column
To display and export a specific data column, or to change its title, add a <column>
element under its related <type>
. In other words, use the column element to control which data columns are shown and exported for a specific object type (and also to define the order of occurrence in the reports).
Attribute | Type | Required/Optional | Default Value | Description |
---|---|---|---|---|
name | String | Required | Define the name of a specific data column (must be the name of an existing data column available on the associated type). | |
Title | String | Optional | name | Provide a title for the data column. Columns with the same title will be combined into one column in the export preview and output. If no title is provided, the column's title or name from its definition will be used. |
feature
/profile
/report
The report
element defines the settings, appearance, and content of a single generated export report of a specific filetype (supporting .xlsx
, .html
, and .pdf
).
Attribute | Type | Required/Optional | Default Value | Description |
---|---|---|---|---|
name | String | Required | N/A | Unique name. |
filename | String | Required | N/A | Defines the file name for the report that is created (ensure that each report has a unique filename to avoid errors caused by duplicate filename). |
generator | String | Required | N/A | The name of the generator (default or custom) responsible for creating the report's file, content, and layout (default available generator includes HighstageExcel , HighstageHtml , HighstageJson , HighstageTemplatedExcel ). |
feature
/profile
/report
/resource
Item containing template file for specific reports (may be required by certain report
elements).
Note: It is only possible to use objects that have an associated folder. This includes Documents, Actions, Parts, Devices, and other item-based types. Objects without a folder cannot be used.
Attribute | Type | Required/Optional | Default Value | Description |
---|---|---|---|---|
name | String | Required | N/A | Unique name. |
objname | String | Required | N/A | Name of object. |
objtype | String | Required | N/A | Type of object. |
filter | String | either filter or version must be defined, but not both. | N/A | Use filter xor version .Specify the filter to select the a single object version/revision when more exists (e.g., latest approved, latest etc.). Must be a filter available for the specified type. |
version | String | either filter or version must be defined, but not both. | N/A | Use filter xor version .Define which specific version (version/revision) of the object to be used as generator template. |
regex-file-pattern | Regex | Optional | primary file. | A regular expression (regex) that defines which template(from the associated object) that will be used as template for the generator. If no regex pattern is defined, we simply select the primary file associated with the object. |
feature
/profile
/attachment
Note: It is only possible to use objects that have an associated folder. This includes Documents, Actions, Parts, Devices, and other item-based types. Objects without a folder cannot be used.
The attachment
element allows you to include additional files in your export, such as instructions for reading the export content, even if they are not part of the exported structure.
Attachments (files associated with the attached objects) will always be placed in the root folder of the exported contents.
Attribute | Type | Required/Optional | Default Value | Description |
---|---|---|---|---|
name | String | Required | N/A | Unique name. |
objname | String | Required | N/A | Name of object. |
objtype | String | Required | N/A | Type of object specified in the obj attribute. |
filter | String | either filter or version must be defined, but not both. | N/A | Use filter xor version .Specify the filter to select the a single object version/revision when more exists (e.g., latest approved, latest etc.). Must be a filter available for the specified type. |
version | String | either filter or version must be defined, but not both. | N/A | Use filter xor version .Define which specific version (version/revision) of the object to be used as attachment. |
regex-file-pattern | Regex | Optional | primary file. | A regular expression (regex) that defines which files (from the associated object) that will be included as files in the exported content package. If no regex pattern is defined, we simply select the primary file associated with the object. |
Export reports in Highstage are highly customizable to meet the different needs and preferences of each organization. These reports contain all data linked to the exported BOM.
To support this flexibility, Highstage lets you create your own dynamic report generators. You can define the file type, layout, formatting, and most importantly—the content of the export reports.
Highstage supports four standard report formats and also allows for dynamic report generators. Dynamic report generation lets customers implement their own custom report formats.
A set of built-in generators is included in Highstage to handle the most common use cases. For more advanced needs—such as data processing, merging, summarizing, or using custom file formats—you can create your own dynamic report generators.
By creating custom .aspx
files and linking them to a report as a generator, you gain full control over the report generation. The interface gives access to all export data, so you can fully define the structure and content of your custom reports.
The four standard reports prints all data included in the export profile. Highstage includes four ready-to-use report generators that can be used in the <report>
element:
HighstageExcel
Outputs an Excel file (.Xlsx
) showing the BOM structure and data using the columns defined in your export profile setup.
HighstageHtml
Produces an Html report (.Html
) that lists the BOM structure and data using the columns defined in your export profile setup. Similar to the structure and data of HighstageExcel
.
HighstageJson
Outputs a compact Json (.Json
) file for use in systems or scripts. It uses raw data values instead of data column titles (e.g, status will return 1
instead of working
).
HighstageTemplatedExcel Lets you use your own Excel file as a layout template. The export fills in your template with data, letting you control layout, sheets, and styling.
This export profile is distributed by default with Highstage for all standard types that have an associated folder (including Documents, Actions, Parts, Devices):
xxxxxxxxxx
101<type name="ts_item">
2 <feature name="export">
3 <profile name="default"
4 included-types="*"
5 regex-file-pattern="^[^~].*"
6 filename="~export-@[o]-@[safe-datetime]"
7 foldername="~exports"
8 export-roles="Resource;Resources;Manager;TeamMember;SuperUser">
9 </profile>
10 </type>
name: Name of export profile (shown to end user when selecting which profile to use).
included-types: Export will include all objects of any type (*
represents all).
regex-file-pattern: A regular expression that excludes all files starting with ~
from the export (but includes everything else).
filename: The filename of the export package (e.g, ~export-ASM12345-4-2025-06-16T1229.ZIP).
foldername: In the folder of the object you are exporting from, a folder named ~exports
will be created to store the export packages.
export-roles: In this case, only users with one or more of the listed vector roles on the object are allowed to export using this profile.
Note: This profile does not include any type definitions. The export will include the same data columns shown in the reference sections for the objects in your BOM (as defined in the
ref-columns
attribute on the<grid>
element used by default for any object type).
Highstage includes four ready-to-use report generators that can be used in the <report>
element as introduced here.
This is an example of a profile that creates 4 unique reports for every successfully executed export, using all the default generators; HighstageExcel
, HighstageHtml
, HighstageJson
, and HighstageTemplatedExcel
(defined as values in the generator attribute for each <report>
element):
xxxxxxxxxx
171<type name="part">
2 <feature name="export">
3 <profile name="example-export-templates"
4 included-types="*"
5 regex-file-pattern="^[^~].*"
6 filename="~export-@[o]-@[safe-datetime]"
7 foldername="~exports"
8 export-roles="Resource;Resources;Manager;TeamMember;SuperUser">
9 <report name="report1" generator="HighstageExcel" filename="@[o]-export-@[safe-datetime]-A" />
10 <report name="report2" generator="HighstageHtml" filename="@[o]-export-@[safe-datetime]-B" />
11 <report name="report3" generator="HighstageJson" filename="@[o]-export-@[safe-datetime]-C" />
12 <report name="report4" generator="HighstageTemplatedExcel" filename="@[o]-export-@[safe-datetime]-D">
13 <resource name="template" objname="TEMPLATES12496" objtype="doc" filter="latest" />
14 </report>
15 </profile>
16 </feature>
17 </type>
Note: Make sure each filename is unique. Reports may not use the same filename and will result in an error.
Each completed export package will include 4 generated reports with relevant BOM data:
The HighstageExcel
generator creates an .xlsx report with basic BOM information (details, level, objects, and related data):
The HighstageHtml
generator creates a .html
report with basic BOM information (details, level, objects, and related data):
The HighstageJson
generator creates a .json
file which is a technical report with data about the exported BOM structure. This report is mainly for external systems and is not intended to be human-readable.
Output data: Note: The
.JSON
report includes the raw database values, not the column titles used in other reports (E.g, the .json report returns1
instead ofworking
for the status column from Documents).
The HighstageTemplatedExcel
generator uses a preexisting Excel file as a template to insert BOM data. This lets you maintain a .xlsx
file that we use a a template in Highstage, giving you full control over the report's style, layout, and content:
Setup of Excel templates using the
<resource>
element:When using the
HighstageTemplatedExcel
generator, you must use the<resource>
element to assign an.xlsx
template for the generated reports. Point it to an existing object in Highstage that contains an.xlsx
file. In the Excel file, the system looks for a cell named[table_start]
(can be located on any tab):
The system uses this Excel file as a template and inserts BOM data starting at
[table_start]
.
If you need reports not covered by the standard generators, you can create custom generators. This gives you full control over file types and content, including manipulation, aggregation, and consolidation of data and much more.
You can generate any file type as an export report, as long as you can write the file’s content to a C# stream. The interface provides all the export data you need to build your report exactly how you want it.
We provide two custom generators as a starting point for creating your own: HighstageHelloWorld.aspx
and HighstageExcelConsolidatedSupplier.aspx
. You can find them at ../ts_webapp/ts/export/generators
:
HighstageHelloWorld.aspx
is a boilerplate generator that creates a .txt
file containing the Object ID of the object where the export was initiated from.
ConsolidatedSupplierReport.aspx
generates an Excel report that consolidates supplier data.
Instead of listing child suppliers separately, their data is shown as columns next to the parent supplier’s columns.
Quantities are also aggregated — for example, if a box is made from six plates, and each plate requires four screws, the report will show a total of 24 screws.
Copy an existing template or create your own .aspx
generator, and place it in your dedicated tweak folder.
Create your own .aspx
generator by implementing TS.Object.Export.IReportGenerator
and assigning an appropriate class name for your generator (e.g., CustomExportGenerator
):
x1<% Page Language="C#" ValidateRequest="false" EnableSessionState="false" EnableViewState="false" %>
2
3<% Import Namespace="System.Xml" %>
4<% Import Namespace="System.IO" %>
5<% Import Namespace="TS.Object.Export" %>
6<%
7 TS.Xhtml.PageBuilder page = new TS.Xhtml.PageBuilder();
8 page.Begin(nameof(CustomExportGenerator));
9 page.Append(new CustomExportGenerator().GetType().ToString());
10 page.End();
11%>
12
13<script runat="server">
14 public class CustomExportGenerator : TS.Object.Export.IReportGenerator
15 {
16 public Stream GenerateReport(Tree tree, ExportProfile exportProfile, ReportProfile reportProfile)
17 {
18 MemoryStream ms = new MemoryStream();
19 StreamWriter writer = new StreamWriter(ms);
20
21 writer.WriteLine("Hello World!");
22 writer.WriteLine("Root key: "+tree.Root.Object.Key.PrimaryKey);
23 writer.Flush();
24
25 return ms;
26 }
27 public string FileExtension => "txt";
28 public bool RequiresTemplate => false;
29 }
30</script>
31
Insert an <execute>
element into your custom.schema.xml
(or any included .xml schema file in your dedicated tweak folder) pointing to the directory of the .aspx
generator:
xxxxxxxxxx
11 <execute name="custom-generator " src="~/tweak/customgenerator.exe.aspx" />
Note: The
<execute>
element must be placed outside of any<type>
element.
To retrieve the name of your custom generator, call the .aspx
file in a browser. The name will be displayed like this:
Note: The generator name will change if you move the
.aspx
file or rename the class in the file. You will then need to retrieve the updated generator name by calling the.aspx
file in a browser.
You can now use your generator in a <report>
element within any export profile definition:
xxxxxxxxxx
91<feature name="export">
2 <profile ...>
3 <report
4 name="custom-report"
5 generator="ASP.tweak_customgenerator_exe_aspx+CustomExportGenerator"
6 filename="custom-report"
7 />
8 </profile>
9</feature>
Restart Highstage for all changes to be applied.
You have now configured your custom report generator and added it to one or more export profiles. When you use these profiles, the export package will include the generated reports: