Export Reports to Microsoft Word, Excel, and RTF

Export input data and calculation results to Microsoft Word using custom templates.

To export data:

  1. Select File > Export > Report into MS Word, Excel
  2. Choose data to export
  3. Select output format (.docx, .xlsx, or .rtf)
  4. Click OK

Note: When exporting to cloud services (Dropbox, etc.), save reports to local drive first to avoid empty files.

1. Custom Templates

Templates are standard .docx files edited in MS Word. Use special markup language to control output formatting.

PASS/START-PROF includes basic templates for common design codes and languages. Users can modify existing templates or create custom sets.

Set template folder path in General Settings > Paths to Files > Templates. Create multiple template folders and switch between them as needed. Root templates (names starting with "A4") correspond to specific design codes.

2. Report Settings

Set output documentation language: Service > Settings > Language > Language of output documents

Add user information for reports: File > Project Settings > Info

Field Variable
Title user.Title
Project Name user.Project_name
Client user.Client
Document Number user.document_No
Revision user.Revision
Revision Date user.revision_date
Approved user.approved
Checker user.checked
Prepared user.prepared

 

3. Template Sets

Default template location: ..\CTAPTPR\Templates\

Each design code has a root template that may include embedded templates. Together they form a template set.

Create language-specific template sets in these subdirectories:

Language Folder Name
English en
Spanish esp
Chinese ch
Russian ru

When language-specific folders exist, root directory templates are ignored for that language.

4. Data Tables

PASS/START-PROF generates text data tables during export, saved as .tbl files in ..\AppData\Local\Temp

Data tables contain sections bracketed by section names: [section_name]

Two section types:

Each table has two sections: meta (map type) and data (table type). Meta section describes field parameters.

Meta format:

<id>[=<val>[,<name>[,<type>[,<units>[,<factor>]]]]]

Example: foo=,42,,0.5 defines:

id name type units factor
foo foo 42   0.5

Data section contains values corresponding to meta field order.

Example data table:

[meta]

node_start

node_end

x=,,,mm

y=,,,mm

z=,,,mm

material=,,1

[data]

1,2,1000,0,0,A106 B

2,3,0,1000,0,A106 B

3,4,0,1000,0,A106 B

This produces:

node_start node_end x y z Material
1 2 1000 0 0 A106 B
2 3 0 1000 0 A106 B
3 4 0 1000 0 A106 B

Fields x, y, z include "mm" unit specification.

5. Template Syntax

5.1. Template Directives

All template expressions use {#...#} delimiters.

Directive format:

{# <tag>[: attributes] #} (variables)

{# <tag>: attributes #} … {# end<tag> #} (sections)

Attributes are comma-separated name or key=value pairs.

Example: {# name: F=c, L=en #}

5.2. Tables

Template processing uses a current table with its own structure and current row.

Iterate through table rows:

{# for: <table>[,<condition> ] #}…{# endfor #}

Optional condition filters records (see "Conditional Directives").

Nested for blocks are supported.

Iterate through table fields:

{# for: [<table>.]fields [,<condition> ] #} {# endfor #}

Field iteration provides access to variable parameters: id, name, val, etc.

5.3. Table of Tables

The tables.tbl file contains generated tables list for user-defined display order.

[meta]

DescrData=,1

Materials=,1

5.4. Auxiliary Data Tables

5.4.1. Translation Tables

Translation tables (translation.tbl) provide multilingual support for variable IDs and text strings.

[meta]

id

en

esp

[data]

DescrData, general data, general data

pipe, tuberia

node, nodo

5.4.2. User Information Table

User data stored in user.tbl file.

5.5. Variables

Variable directives extract data from table fields.

Variable parameters:

Variable format: {# [<table>.]<id>[:<attr1>=<value>,<attr2>=<value2>…] #}

Attributes:

Output types:

Examples:

5.6. Conditional Directives

Conditional directives control template fragment inclusion.

{# if: <condition> #}

[ {# else #} ]

{# endif #}

Supported operators: <, >, ==, !=, <=, >=

Check variable existence: {# if: <name>.exist #}

Short form: {# if: <name> #} equals {# if: <name> != "" #}

5.7. Translation Directive

Translate arbitrary strings: {# tr:<text>, L=<lang> #}

Example: {# tr:"red", L=ru #} = красный

5.8. Images

Include JPEG, BMP, PNG images from data table directory.

{# img: <filename>, w=<width>, h=<height> #}

Width/height in centimeters. Omit both for 100% size.

5.9. Include Templates

Include other templates: {# include: <filename>[, curTable=<table>] #}

Only main document content included. Styles and page settings from root template used.

Examples:

{# include: "Materials.docx" #}

{# for: tables #}

{# name: L=ru, F=c #} ({# name: L=en, F=c #})

{# include: id #}

{# endfor #}

6. Template Generator

Run report generator separately:

..\CTAPTPR\StartReport\NTP.StartReport.Console.exe <main_template> <output> <template_directory> <data>

Parameters:

Menu Access

File > Export > Report into MS Word, Excel