You are on page 1of 60

05-Jan-24 DOCUMENTENGINE REFERENCE Page 1 of 39

Areas and Basic Template Layout


Templates in CargoWise One
A Document or Report Template is an Excel spreadsheet that is laid out in a special format using various
commands and keywords recognized by the Document Engine in CargoWise One, and can be rendered and
merged with data from CargoWise One to generate a Document or Report style output.

The first tab or worksheet of a Template contains the Layout comprised of Areas, Excel formatting and
Macros used to produce the desired output. You should change the name of the tab (right click and rename)
as the name of each tab with a Layout in it is shown on the Preview screen within CargoWise One.

You can optionally include other tabs if you want multiple reports in the one output. You can also add
specially named Interface Tabs to gain access to more advanced features of the Document Engine, but the
first tab contains everything required to produce a Report or Document.

ly
The Interface Tabs you can use on a Report are a Filters Sheet, a Sort Order Sheet and a Group Bys Sheet,
and on a Document are a Fields Sheet (UDF's) and a Constants Sheet. All you need to know about them for

on
now is that Interface Tabs are recognized by the name shown on the tab, and that the full functionality of
these is covered in the Interface Tabs reference.

The first column on the first worksheet is used exclusively for Document Engine Area configurations. This is

U t
where you define the start of each Area of your template, and insert your configuration parameters for the

al s
se
#Config Area. Nothing entered in this column will appear in the final output as it is always hidden by the
Document Engine. ci Te
Area definitions are always made up of a #, and Area Identifier, then optional parameters separated by
colons. Please note, other contents on the same line as Area definitions will be removed at the end of the
creation of the report/document.
er /
m ng

Following is an explanation of the Areas currently supported by the Document Engine and and explanation
of the uses of each.

#Config
i
om in

The first tab page on every template *MUST* start with a #Config Area. You use the #Config Area to specify
parameters that affect the layout and data content of the report or document you're trying to produce.
C a

The #Config Area contains a list of parameters with one parameter and optional value on each line in the
first column of the tab page. Some parameter types also take note of values entered in following columns on
Tr

the same row, but most are contained only in the first column with data separated by an '=' or a ':'.

Reports must have a 'Name' and at least one 'Data' parameter, Documents must have a 'Name' and
'DataContext'. All other parameters are optional. Please note that keywords are always case insensitive, and
this Area is removed from the final output generated from the template.

Supported Parameters:
on

Name={Report Name} - Used to specify the name of the report. E.g: Name=My Report

PageStyle={Page Style} - Allowed Page Style options are: Portrait, Landscape, Continuous, LetterPortrait,
N

LetterLandscape, LetterPortraitMatrix, Custom. E.g: PageStyle=Portrait

If Page Style is set to Custom, the following two parameters are available to set the printout page size:
PageHeight={Page Height} - Used to set the printout page height in millimeters. E.g: PageHeight=900
PageWidth={Page Width} - Used to set the printout page width millimeters. E.g: PageWidth=500

If Page Style is set to Continuous and PageWidth is set, the parameter below is available to make the page
height variable:
AutoPageHeight={AutoPageHeight} - Usually used by roll paper printers. If it is set, the printout page height
05-Jan-24 DOCUMENTENGINE REFERENCE Page 2 of 39
will be set to the height of its content. E.g: AutoPageHeight

Version=nn.nn - Version.Revision number for your template to help you keep track of modifications. Does
not affect the way a document is produced at this point. E.g: Version=1.00

EmailSubject={Email Subject Macro} - The string used to generate the Email Subject when the Report or
Document is output directly to email. Can also include macros. E.g: EmailSubject=My Favorite Data as of
<Now> for <JobNumber>

Data:{DataSourceName}={SQL Statement}[:NoWhereClause] - Used on Reports only to specify all data


sources used. You can specify one or many data sources which are referenced by name in other Areas in
the template. To have multiple data sources, include multiple parameter lines starting with 'Data:'. Can
optionally include ':NoWhereClause' after the select statement to prevent a where clause and order being
built for the statement automatically.

ly
DataContext={Data Context Name} - Used on Documents only to specify the desired type for the top level
data source. When a document is produced, the Document Engine passes the data context specified into

on
the Document Supporter for the current top level business object which returns either one or many data
sources. The type of data source you get back is usually based on the Data Source alone, but may take into
account other factors as well. The range of data contexts supported varies between the Document
Supporters for each type of top level business object.

U t
al s
se
AutoHeightMode=ExpandRow - Switches Auto Height row expansion to expand existing rows rather than
ci Te
inserting additional rows to handle overflowing data in fields. Only has an effect if you specify the
'Continuous' Page Style on a Report.

TrailingFormFeed={Form Length In 360ths Of An Inch} - Allows you to specify the trailing form feed size as a
er /
whole number measured in 360ths of an inch.
m ng

HideSheetIf={Evaluable Expression} - If the expression specified evaluates to 'true', will remove the
worksheet from the final output. E.g: HideSheetIf="Black"=="White" would not hide,
HideSheetIf="White"=="White" would hide.
i

HideColumnIf - Any boolean expressions entered on the same row will cause the column the expression is
om in

entered in to be hidden if the expression evaluates to 'true'. The Document Engine uses the JavaScript
engine to evaluate these expressions, so most types of logical comparisons will work. E.g: 1==1, 2!=1,
C a

"<Contact.Name>"=="Fred"
Tr

SQLQUERYHINTS= these are query hints that override the default behavior of the SQL Query optimizer.
Options include recompile, fast etc. The only the options need to be specified.
'SQLQUERYHINTS=recompile, fast 10' will turn into 'option (recompile, fast 10)'

SQLQUERYHINTSIGNORERECOMPILE - Will ignore 'recompile' query hint (which might be set as default
in registry).

DisableCSVExport - Will disable the option to export report as CSV format. Use this option when there are
on

multiple levels of data in the report, which is not supported by CSV.

DisableFixedValueCacheExpression={Evaluable Expression} - If the expression specified evaluates to 'true',


N

this report will always evaluate the value of UDF (User Defined Field) from its default value specified in
template, it will not use the overridden value Doc Data tab page on the job. E.g:
DisableFixedValueCacheExpression="<IsManufacturerBillOfLading>"=="Y"

DisableTranslate - Used on Reports Only, use this option when the report doesn't need to be translated

ColumnHeadings - Used on Reports Only, specifies the row Option Column Headings are entered on. Any
Column Heading parameter entered on the same row will cause the column the expression is entered in to
be seen by the Document Engine as an Optional Column.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 3 of 39

RemoveFirstPageIfNoData - Use this option to remove the first page if there's no data in it when using
#SectionHeader Area with PageBreak parameter

TranslateLegacyDocument - Used on legacy documents only, use this option when the legacy document
needs to be translated

HideRowsInsteadOfRemove - Use this option to hide the #Config rows in the template when the document
or report is generated in Excel format. The #Config rows are removed by default, and if there are a lot of
rows to remove, this can lead to longer generation times. Please note that when using this option that there
can be a dramatic increase in the total number of rows in the Excel file. So if your report is nearing the limits
of the maximum allowed rows in an Excel file, then do not use this option.

A single Column Heading parameter follows the format


'DisplayLabel="{DisplayLabel}"[,Description="{Description}"][,HeadingText="{HeadingText}"][,Hidden][,Show

ly
PerformanceWarning][,HideIfDescriptionEmpty]' where:
- DisplayLabel is a column key for storing settings etc

on
- Description is a meaningful description of the column that the users use in the report configuration form to
select which columns to show and what order they appear.
- HeadingText specifies the default heading for the column that prints on the report. The user can optionally
override this in the Report Configuration. If no HeadingText is defined, DisplayLabel is used instead.

U t
- Hidden is used to indicate that the column is hidden unless the user decides to include it.

al s
se
- ShowPerformanceWarning is used to indicate that the column has potential performance problems and the
user is advised not to include it.ci Te
- HideIfDescriptionEmpty is used to indicate that the column should be hidden from the report if the
Description of that column is blank. E.g: DisplayLabel="Total Earnings",Hidden
er /
DocumentCurrency={Currency Code} - Used to apply special currency format on selected columns.
'ApplyDocumentCurrency' entered on the same row, will cause the the column where expression is entered
m ng

in to have its decimal value in the selected currency format.


'Currency Code' may be a 3-letter code of currency or any macros that will return currency code (e.g.
<CompanyCurrencyCode> etc.). Formatting will be applied only on body SectionBody and GroupBy Areas
of a document.
i
om in

A completed Template will have a #Config Area looking something like this:
C a

#Config
Name=Test Template
Tr

PageStyle=Portrait
Data:Notes=select * from NotesTable
#DocumentHeader
...
#EndOfReport

#DocumentHeader
on

Shows at the very top of the first page before all other Areas, but doesn't get printed on any following pages.

If you want an Area that prints at the very top of every page, use a #PageHeader Area instead.
N

Please note that a #DocumentHeader Area can be split across multiple pages if it's too long, but a
#PageHeader cannot.

You can only have one #DocumentHeader Area.

#PageHeader[:StartFromSecondPage]
Will show at the top of every page but after the #DocumentHeader Area on the first page (if specified) and
not at all on the first page if the optional ':StartFromSecondPage' parameter is specified.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 4 of 39

Generally people use a #DocumentHeader on the first page and #PageHeader:StartFromSecondPage


where they want a different header on the first page to the follow pages, or a #PageHeader Area on its own
where they want each page to start with the same thing.

You can only have one #PageHeader Area whether you specify the ':StartFromSecondPage' parameter or
not.

#SectionHeader[:ShowEvenWithNoData][:PageBreak][:Sticky]
A #SectionHeader Area shows once at the beginning of a Body Section and once only.

This Area will not repeat if the Body Section flows over onto the next page, if you want a header to print on
follow pages you will need to use a #SectionPageHeader Area as well.

ly
A Body Section may comprise of any combination of the Areas #SectionHeader, #SectionPageHeader,
#SectionBody, #GroupBy, #SectionPageFooter and #SectionFooter with the following conditions:
1. You can only have one of each Area type in each Body Section except for the #GroupBy Area which may

on
be defined many times where #GroupBy headers and footers are required, or nested levels of grouping are
required.
2. Any Areas specified *must* be in the order specified or the Document Engine will see them as part of the

U t
next Body Section.

al s
se
3. You can have multiple Body Sections, even operating out of the same collections of tables.
4. Each Body Section will use the data source defined in the parameters on the #SectionBody for all Areas in
that Body Section. ci Te
Optional Parameters:
ShowEvenWithNoData - Will cause the contents of the #SectionHeader Area to show even if there are no
er /
rows in the data source specified by the #SectionBody Area.
PageBreak - Makes the Body Section start on a new page.
m ng

Sticky - Will make sure that the #SectionHeader Area won't print on a page if there's not enough room to
print the first row of the #SectionBody Area with it.

#SectionPageHeader[:Sticky]
i
om in

Is printed at the top of each new page when a Body Section is split across multiple pages.

Please note that this does not print on the first page the Body Section starts on if a #SectionHeader Area
C a

already exists. And make sure that the excel template file's page style setting is consistent with the
Tr

PageStyle setting in the #Config Area.

Optional Parameters:
Sticky - Will make sure that the #SectionPageHeader Area won't print on a page if there's not enough room
to print the first row of the #SectionBody Area with it.

#SectionBody:Data={DataRowSource}[:OptionalParam1[:OptionalParam..n]]
#SectionBody Areas are used to output single or multiple rows from a given Data Row Source. A Data Row
on

Source can be a Data Source Name for Reports, or a Child Collection for Documents.

The contents of this Area will be replicated once for every row in the specified Data Row Source. As many
rows as possible will be output on each page taking note of the amount of space available, the amount of
N

space the #SectionPageFooter Area and #PageFooter Areas will take, and the relevant optional parameters
shown below.

If you just want to output one Body Section unrelated to a particular Data Row Source, use the Data Row
Source 'DummyCollection'. i.e:
#SectionBody:Data=DummyCollection

Optional Parameters:
05-Jan-24 DOCUMENTENGINE REFERENCE Page 5 of 39
FilterBy(Logical Expression) - Filters the Data source to include only the records which match the Logical
Expression. NB: This only applies to Documents with a Business Object data source, not to Reports that
have an SQL data source.
OrderBy(column) - Sort the collection by a column of the type of collection business object and the direction.
The direction parameter is optional, either ‘ASC’(ascending) or ‘DESC’(descending). NB: This only applies to
Documents with a Business Object data source, not applicable to Reports which have SQL data source.
MaximumNumberOfRowsToShow={number} - Specifies the maximum number of rows to show on each
page this Body Section is shown on. MaximumNumberOfRowsToShow must be a multiple of
RowCountAMultipleOf if specified.
NumberOfRowsToShow={number} - Specifies the actual number of rows that will be output on each page
the Body Section appears on. If there are less actual rows than what you specify for a page, blank rows are
inserted into the output to make up the difference.
RowCountAMultipleOf={number} - Ensure the number of rows returned are a multiple of the number
specified. If the actual number of rows is not a multiple of the number specified, blank rows are inserted into
the output to bring it up to a multiple.

ly
StartingRowToShow={number} - Indicates the first row the Body Section should output. The
StartingRowToShow must not be greater than the MaximumNumberOfRowsToShow. NB: 1 indicates the

on
first row, not 0.
Sticky - Will try and stop an individual Body Section being split across multiple pages.
CustomSorting - Indicates its GroupBy collection will not be re-ordered by the GroupBy column(s). Please
note this parameter is only available in documents and cannot be used together with OrderBy.

U t
al s
se
#GroupBy:{GroupByColumns}[:GroupTitle[:Sticky]][:PageBreak][:KeepInSamePage]
ci Te
#GroupBy Areas are used to group rows from the Data Row Source together where the fields specified in
the GroupByColumns parameter are the same. You can specify multiple fields separated by + signs where
required.
er /
By default the contents of the #GroupBy Area will show just after the group of #SectionBody Areas where
the GroupByColumns match. You can make a #GroupBy Area appear before the matching group of
m ng

#SectionBody Areas by specifying the ':GroupTitle' parameter.

If you want one before and one after each group, specify a #GroupBy Area with the ':GroupTitle' parameter
and it contents, then another #GroupBy Area without the ':GroupTitle' parameter, but make sure the
i
om in

GroupByColumns parameter is identical on both of them.

Optional Parameters:
C a

GroupTitle - Makes this #GroupBy Area appear before the group it represents. Default is to appear after the
group it represents.
Tr

PageBreak - Insert a page break just before rendering this Area.


Sticky - Try and keep the #GroupBy Area together with it's first #SectionBody Area row. This only works
when using the ':GroupTitle' optional parameter.
KeepInSamePage - Try and keep the #GroupBy Area together with it's #SectionBody Area rows whenever
possible. This only works when using the ':GroupTitle' optional parameter.

#SectionPageFooter
on

Contents of this Area will be rendered at the bottom of each page above the #PageFooter Area where the
Body Section continues onto the next page.

This Area will not be rendered at the very end of a Body Section, if that's what you want use a
N

#SectionFooter Area.

#SectionFooter[:ShowEvenWithNoData]
Contents of this Area are rendered at the very end of a Body Section.

This Area will not be rendered at the bottom of each page where the Body Section continues onto the next
page, if that's what you want use a #SectionPageFooter Area.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 6 of 39
Optional Parameters:
ShowEvenWithNoData - Show this Area even if there are no rows in the Data Row Source specified by the
associated #SectionBody Area.

#FirstPageFooter
Is rendered at the very bottom of the first page when there's more than one page in the generated output.

This means that a #LastPageFooter or #PageFooter will be used in preference over a #FirstPageFooter for a
one page result.

If you want an Area to be rendered at the bottom of the first page always, you'll need to include an
#OnlyOnePageFooter *and* a #FirstPageFooter Area with the contents repeated where necessary.

#PageFooter

ly
This Area will print at the very bottom of each and every page unless there's a #FirstPageFooter,
#LastPageFooter or #OnlyOnePageFooter better suited to the particular page being rendered.

on
Contrary to popular belief, a #PageFooter Area will print after the #DocumentFooter Area (if defined) on
every page the #DocumentFooter Area is printed on.

U t
All types of #PageFooter Areas *cannot* be spread across multiple pages as they are designed to finish the

al s
se
page, not be part of the body.

ci Te
Please keep in mind that it's impossible to print a page when a #PageFooter Area is too long to fit on one
page when used in combination with the #DocumentHeader and/or #PageHeader.

If you want an Area at the end of your output that can be split across multiple pages, use the
er /
#DocumentFooter Area instead.
m ng

#OnlyOnePageFooter
This Area will be shown at the very bottom of the first page if there's one page only in the generated output.
i

If there's more than one page, this Area will not be rendered.
om in

This will override the #LastPageFooter and #PageFooter when there's only one page.
C a

#LastPageFooter
Tr

Will always be rendered at the very bottom of the last page in the generated output unless there is an
#OnlyOnePageFooter Area and the generated output has one page.

This means that a #LastPageFooter will be used in preference on the last page over a #FirstPageFooter or a
#PageFooter even in a one page result.

#DocumentFooter[:Don't Split]
The #DocumentFooter Area prints after the last Body Section, but before the last Page Footer Area
on

regardless of which Page Footer type that ends up being.

This means that although the #DocumentFooter will certainly end on the last page, it will not necessarily be
N

the last thing showing at the *BOTTOM* of the last page. If that's what you're after, use the #LastPageFooter
Area instead.

Generally this Area is used for signature Areas on notification Documents or for grand total Areas on
Reports

You can include the optional ':Don't Split' parameter to tell the Document Engine to keep all rows in this Area
together so that you don't get half the Document Footer on one page and half on the next. This parameter is
both case and space sensitive, so make sure it's entered character for character including the space
05-Jan-24 DOCUMENTENGINE REFERENCE Page 7 of 39
between Don't and Split.

Please note that you can also keep rows in an Area together by merging the cells in a column vertically
across the rows you want to keep together. The Document Engine know you can't split merged cells and will
deal with this appropriately. This works in all Areas, not just the #DocumentFooter.

#BackPage[:FirstPageOnly]
Contents of a #BackPage Area will be inserted after the first page only if the optional ':FirstPageOnly'
parameter is specified and every end of page if the optional ':FirstPageOnly' parameter is not specified in the
generated output.

Is used to print a fixed back page when using a duplex printer. E.g: printing the terms and conditions on the
back page of a Way Bill.

ly
Please note that you will need to insert your own form feed control commands as back pages sometimes
require unusual form feed coding sequences.

on
#EndOfReport
This indicates the end of the template, and *MUST* be specified to indicate the end of the last Area in the
Template.

U t
al s
se
You can only have one of these, and everything after this identifier will be ignored.

#BeginLoop:Data={DataRowSource}
ci Te
SectionForeach Areas are used to output multiple rows from a given DataRowSource. The DataRowSource
must be a Child Collection of the current SectionBody data source.
This Area can only be used within a SectionBody Area. It must begin with #BeginLoop and end with
er /
#EndLoop.
m ng

E.g:

#SectionBody:Data=XXDummyCollection
i

<MacroA>
om in

#BeginLoop:Data=XXSubCollection1
<MacroB>
#BeginLoop:Data=XXXXSubSubCollection1
C a

<MacroC>
Tr

#EndLoop
#EndLoop
#BeginLoop:Data=XXSubCollection2
<MacroD>
# EndLoop

Here XXSubCollection1 and XXSubCollection2 are sub-collections of every record in XXDummyCollection,


and XXXXSubSubCollection1 is a sub-collection of every record in XXSubCollection1.
on

Please note:
1. the DataRowSource of SectionForeachArea must be a Collection.
2. if the value of macros cannot be resolved via the Area DataSource, DocEngine will try to resolve it against
N

its parent's DataSource.


3. this Area is only to output records of collections and does not support SUM/TOTAL/Formula etc.
4. The use of other contents on the same line as #BeginLoop/#EndLoop is not allowed, the intended data
will not show as those two lines will be removed at the end of the creation of the document.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 8 of 39
#IF {LogicalExpression}
...
[#ELSE]
...
#ENDIF
Conditional Areas are used within other Areas to add or remove rows from the Template before the data is
merged into the Template and the Template is rendered.

The #IF {Logical Expression}, #ELSE and #ENDIF identifiers are always entered in the first column of the
spreadsheet, and anything in subsequent columns on those rows will not be included in the final output. You
can also nest Conditional Areas, but for each #IF you must have a corresponding #ENDIF or your template
will not be able to be rendered.

ly
They're processed before any of the Body Sections are rendered, which means that if you use them in a
Body Section they will be processed once before the Document Engine iterates through all of the rows. This
means that all rows will evaluate the same for each and every row in a Body Section regardless of the

on
content of the individual rows.

If you want rows to be hidden conditionally depending on the data in each row, use the <HideRowIf({Logical

U t
Expression})> or <HideRowIfCellIsEmpty> macros as appropriate. You can hide the hide macros if

al s
se
required in a column out to the right by adding a HideColumnIf parameter in the #Config Area, and entering
'1==1' in the column you want to hide on the HideColumnIf row.
ci Te
You should only use #IF..#ELSE..#ENDIF Areas within the other Areas. Don't use them to conditionally
exclude other Areas as this will have unpredictable results.
er /
The Document Engine uses the Microsoft JavaScript evaluator to evaluate the logical expression passed, so
most logical expressions will work. E.g:
m ng

#IF 1==1
#IF "<MyField>"!=""
#IF <CurrentPage> > 3
i
om in
C a
on Tr
N
05-Jan-24 DOCUMENTENGINE REFERENCE Page 9 of 39

Common Fields and Macros (available in all DataContexts)


<{ReportDataSourceName}.SelectList>
Returns a syntactically correct SQL Select statement for all the columns actually shown or referenced in the
Excel template for a given Report Data Source. The syntax of the macro is
<{ReportDataSourceName}.SelectList>
E.g: <ReportData.SelectList>

<AbriBar128sBarCode('{StringValue}'[, UseOptimisedEncoding][, IsGS1128Barcode])>


Is used to convert a string value into a barcode text format. The extra parameter is used in the optimization
mechanism.
If use option IsGS1128Barcode with multiple AIs, please add a comma before AI which is variable length to
separate these AIs.
Use this in conjunction with the AbriBar128s font.
E.g: <AbriBar128sBarCode('S00001234')>

ly
E.g: <AbriBar128sBarCode('<ShipmentNumber>', UseOptimisedEncoding)>
E.g: <AbriBar128sBarCode('S00001234, S00005678', IsGS1128Barcode)>

on
<Absolute({decimalamount})>
Returns the absolute value of specified amount.
E.g: <Absolute(<ARInvoice.OSTotal>)>

U t
al s
se
<AccumulativeTotal {fieldname}> or <AccumulativeTotalWithReset {fieldname}>
AccumulativeTotal will return an accumulative total of all prior occurrences of the field specified by
ci Te
{fieldname}. AccumulativeTotalWithReset will also reset the total so that all subsequent AccumulativeTotal
for the specified fields won't include fields already covered.
E.g: <AccumulativeTotal InvoiceLines.Amount>
E.g: <AccumulativeTotalWithReset InvoiceLines.Amount>
er /
m ng

<Add("{value1}","{value2}",...)>
Will do the addition of two or more values.
E.g: <Add("10", "20", "30")>
E.g:
i

<Add("<GenericTransactionHeader.TotalOSAmount>","<GenericTransactionHeader.OSOutstandingAmou
om in

nt>","<GenericTransactionHeader.OSOutstandingAmount>")>

<AddDurationToDate({date},{span},{value})>
C a

Add or subtract time from a date. Span can be any of the following time spans:
Tr

DAYS, HOURS, MINUTES, SECONDS or MILLISECONDS.


E.g: <AddDurationToDate("<JK_MasterBillIssueDate>", "DAYS", "1")>

<AddTitleIfNotEmpty("{StartingTitle}", "{Value}", "{EndingTitle}")>


If {Value} is not empty returns {StartingTitle} + {Value} + {EndingTitle}. If {Value} is empty, returns a blank
string.
E.g: <AddTitleIfNotEmpty("Consignor: ", "<ConsignorName>", ", ")>
on

<ApprovalTaskUrl({tableCode}, {taskPK})>
Returns a URL that will allow user to action an Approval task.
The link will work on systems that have GLOW Portal configured in the registry.
E.g: <ApprovalTaskUrl(JS, <Task.P9_PK>)>
N

<AttachmentType>
This macro returns the 'Attachment Type' in 'Templates Used'.
E.g: <AttachmentType>

<AutoHeight[({minimumRows}[, RemoveLineBreaksToFit])]>
Used as a prefix to a subsequent macro.
If the value inserted by the subsequent macro won't fit in the cell in the template, additional rows will be
05-Jan-24 DOCUMENTENGINE REFERENCE Page 10 of 39
inserted below to show any text that won't fit on the first.

NB: This was designed for use in #SectionBody sections only to make it so that large body sections could be
broken up over multiple pages. May cause pagination issues if you try and use it in header or footer
sections. You can use 'Wrap Text' (Format the Cell in Excel) if you want a single unmerged cell to expand in
a header or footer, or put your <AutoHeight>'ed field in a new '#SectionBody:Data=DummyCollection'
section so that pagination can be taken care of properly.

You can not use this <AutoHeight> macro within a formula or nested within another macro.

Optionally the minimum number of rows can be set; The row will always expand to the minimum number of
rows specified.

Optionally specify the 'RemoveLineBreaksToFit' flag which, if the content in the row is too tall to fit within the
Excel size limit, will remove line breaks from the text to try and fit. If the content is still too big it will be split

ly
across multiple rows as per normal.

on
This macro will not work if it is used together with TFormula macro (<AccumulativeTotal {fieldname}> or
<AccumulativeTotalWithReset {fieldname}>,<Total {fieldname}>).

U t
al s
se
E.g: <AutoHeight><InvoiceLine.GoodsDescription>
ci Te
E.g: <AutoHeight(5)><InvoiceLine.GoodsDescription>
E.g: <AutoHeight(5, RemoveLineBreaksToFit)><InvoiceLine.GoodsDescription>
E.g: <AutoHeight(RemoveLineBreaksToFit)><InvoiceLine.GoodsDescription>
er /
<BalanceSheetStartingAccount>
Returns the Account Number for the Balance Sheet Starting Account.
m ng

E.g: <BalanceSheetStartingAccount>

<BoolToYN({boolvalue})>
Returns the Y for true, N for false.
i

E.g: <BoolToYN(<ChargeCode.IsActive>)>
om in

E.g: <BoolToYN(<Is Active>)>


C a

<BranchCode>
Returns the Branch Code for the Current Branch.
Tr

E.g: <BranchCode>

<BranchPortName>
Returns the name of the location of the current branch.
E.g: <BranchPortName>

<BranchProxy>
Returns the Organization Proxy for the Current Branch. If the Organization Proxy is not set on the Current
on

Branch, falls back to the Organization Proxy for the Current Company.
E.g: <BranchProxy>
N

<BranchProxyCode>
Returns the Organization Proxy Code for the Current Branch. If the Organization Proxy is not set on the
Current Branch, falls back to the Organization Proxy Code for the Current Company.
E.g: <BranchProxyCode>

<BranchProxyName>
Returns the Organization Proxy Name for the Current Branch. If the Organization Proxy is not set on the
Current Branch, falls back to the Organization Proxy Name for the Current Company.
E.g: <BranchProxyName>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 11 of 39

<CalculateConsolChargeable({xxx})>
Returns a calculated chargeable for the Consol indicated by the UniqueConsignRef, Cached inside.
E.g: <CalculateConsolChargeable(<Consol.JK_UniqueConsignRef>)>

<CapitaliseFirstLetterOfWords({fieldname})>
Capitalizes the first letter of each word and converts all other characters to lower case.
E.g: <CapitaliseFirstLetterOfWords(Job.Consignee)>

<ChangeCase("{text}", L|U|T)>
Returns the supplied string with case changed according to second parameter value:
L - lower case;
U - UPPER CASE;
T - Title Case
E.g: <ChangeCase("Hello Hello", U)>

ly
E.g: <ChangeCase("Hello Hello", L)>
E.g: <ChangeCase("heLlo hEllo", T)>

on
<ChinaBalanceSheetStartingAccount>
Returns the Balance Sheet Starting Account Number for China.
E.g: <ChinaBalanceSheetStartingAccount>

U t
al s
se
<Coalesce("{fieldPath}", "{defaultValue}")>
ci Te
If {fieldPath} cannot be found, is empty or is null, returns {defaultValue}. Otherwise, returns {fieldPath}.
E.g: <Coalesce("<JS_ActualChargeable>", "0")>

<CODE-39("{InputText}",{WidthInColumns},{HeightInRows})>
er /
Returns a CODE-39 code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
m ng

- HeightInRows: Number of rows to span in Excel.


E.g: <CODE-39("<BarCodeText>", 2, 4)>

<CodePairValue({provider}, {field}, {index}[ ,TreatIndexAsString])>


i

Returns the field value(s) (code or description) from specified value pair provider's element with specified
om in

index. When {index} equals 'All', returns comma-separated list of all values. {index} is 1-based or string
Code. The extra parameter is used if {index} is always a string Code.
C a

E.g: <CodePairValue(StorageClass, Code, 1)>


E.g: <CodePairValue(StorageClass, Description, 20F)>
Tr

E.g: <CodePairValue(StorageClass, Description, 20F, TreatIndexAsString)>


E.g: <CodePairValue(StorageClass, Description, "<Storage Amount>")>

<CompanyAddress1>
Returns the first line of address from the current Company's registration in GlbCompany.
E.g: <CompanyAddress1>

<CompanyAddress2>
on

Returns the second line of address from the current Company's registration in GlbCompany.
E.g: <CompanyAddress2>
N

<CompanyCity>
Returns the City from the current Company's registration in GlbCompany.
E.g: <CompanyCity>

<CompanyCode>
Returns the Company Code from the current Company's registration in GlbCompany.
E.g: <CompanyCode>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 12 of 39
<CompanyCountry>
Returns the Country/Region Name from the current Company's registration in GlbCompany.
E.g: <CompanyCountry>

<CompanyCountryCode>
Returns the ISO Country/Region Code from the current Company's registration in GlbCompany.
E.g: <CompanyCountryCode>

<CompanyCurrencyCode>
Returns the ISO Currency Code from the current Company's registration in GlbCompany.
E.g: <CompanyCurrencyCode>

<CompanyCustomsCountryCode>
Returns the effective ISO Country/Region Code under Customs' perspective from the current Company's
registration in GlbCompany.

ly
E.g: <CompanyCustomsCountryCode>

on
<CompanyCustomsCurrencyCode>
Returns the ISO Currency Code from Customs' perspective from the current Company's registration in
GlbCompany.
E.g: <CompanyCustomsCurrencyCode>

U t
al s
se
<CompanyFax>
ci Te
Returns the Fax Number from the current Company's registration in GlbCompany.
E.g: <CompanyFax>

<CompanyIsReciprocal>
er /
Returns the 'Is Reciprocal Exchange Rate' flag from the current Company's registration in GlbCompany.
E.g: <CompanyIsReciprocal>
m ng

<CompanyLicenceInfo([{PK}]).{Property})>
This macro is used to access licensing information for the given company. If you don't specify a PK or the PK
is not recognized, will return values from the Current Company you are logged into. The 3 properties you can
i

use are LicenceServerID, LicenceEnterpriseCode and LicenceCompanyCode.


om in

E.g: <CompanyLicenceInfo().LicenceServerID>
E.g: <CompanyLicenceInfo().LicenceEnterpriseCode>
C a

E.g: <CompanyLicenceInfo(<CompanyPK>).LicenceCompanyCode>
Tr

<CompanyName>
Returns the Company Name from the current Company's registration in GlbCompany.
E.g: <CompanyName>

<CompanyNameChina>
Returns the Company Name from the main Accounts Receivable Address against the Organization Proxy on
the current Company's registration in GlbCompany. That has the capability to store Chinese Characters.
E.g: <CompanyNameChina>
on

<CompanyNameFromPK({companypk})>
Returns the Company Name from the given company PK.
N

E.g: <CompanyNameFromPK(<CompanyPK>)>

<CompanyOfficeAddress1>
Returns the first line of address from Organization Proxy on the current Company's registration in
GlbCompany.
E.g: <CompanyOfficeAddress1>

<CompanyOfficeAddress2>
Returns the second line of address from Organization Proxy on the current Company's registration in
05-Jan-24 DOCUMENTENGINE REFERENCE Page 13 of 39
GlbCompany.
E.g: <CompanyOfficeAddress2>

<CompanyPhone>
Returns the Phone Number from the current Company's registration in GlbCompany.
E.g: <CompanyPhone>

<CompanyPK>
Returns the PK for the current GlbCompany as a GUID.
E.g: <CompanyPK>

<CompanyPostalAddress1>
Returns the first line of the Postal Address from Organization Proxy on the current Company's registration in
GlbCompany.
E.g: <CompanyPostalAddress1>

ly
<CompanyPostalAddress2>

on
Returns the second line of the Postal Address from Organization Proxy on the current Company's
registration in GlbCompany.
E.g: <CompanyPostalAddress2>

U t
<CompanyPostCode>

al s
se
Returns the Postcode from the current Company's registration in GlbCompany.
E.g: <CompanyPostCode>

<CompanyProxyCode>
ci Te
Returns the Organization Proxy Code for the Current Company.
er /
E.g: <CompanyProxyCode>
m ng

<CompanyReg1>
Returns the primary Business Registration Number from the current Company's registration in GlbCompany.
E.g: <CompanyReg1>
i

<CompanyReg2>
om in

Returns the secondary Business Registration Number from the current Company's registration in
GlbCompany.
C a

E.g: <CompanyReg2>
Tr

<CompanyState>
Returns the State from the current Company's registration in GlbCompany.
E.g: <CompanyState>

<CompanyWebAddress>
Returns the Web Site Address (URL) from the current Company's registration in GlbCompany.
E.g: <CompanyWebAddress>
on

<ComplianceDocumentSupportingReasonDescription({supportingReasonCode},{ledger})>
Will return the description of the compliance supporting reason code.
E.g: <ComplianceDocumentSupportingReasonDescription(COD, AR)>
N

<ComplianceSubTypeLocalDescription({complianceSubType})>
Will return the local description of the compliance sub type.
E.g: <ComplianceSubTypeLocalDescription(<SubType>)>

<ConsumptionTaxRegistrationCodesList({organisation code})>
For a given Organization, returns the comma-separated list of its registered Consumption Tax codes.
E.g: <ConsumptionTaxRegistrationCodesList(<OrgCode>)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 14 of 39
<Contains("string", "subString")>
Returns "Y" if the string contains the substring, and "N" if it does not, ignoring case.
E.g: <Contains("APPLES", "APP")>
E.g: <Contains("APPLES", "ORANGES")>

<ConvertUTCDateTimeToLocal('{DateValue}')>
Converts a Universal Date Time to a Local Date Time and returns the value as a date object.
E.g: <ConvertUTCDateTimeToLocal('08/08/2007 12:15:30')>
E.g: <ConvertUTCDateTimeToLocal('<ReportDate.CreationTimeUTC>')>

<Count([{tablename}, {logicalExpression}] )>


Returns the number of rows in the specified table.
Optional Parameters:
{tablename} is the table name you want to filter by.
{logicalExpression} is a Logical expression which allows you to count the number of records with a specific

ly
condition.

on
If both parameters are not specified, the <Count()> macro will return:
If inside a Group-by Area - the number of items in the current Group-by Area.
If inside other types of Area that linked to a data source Area - the number of items in the data source of that
Area

U t
E.g: <Count(Lines)>

al s
se
E.g: <Count(Lines, <GST>==5 && (<GSTRate>==5))>

<Counter({key})>
ci Te
Returns a 1 based count of the number of times the expression is shown in the document.
I.e: First time it is hit for a given key, returns a 1. Second time it returns a 2 etc. Every different key you use
er /
will start a new sequence at 1.
E.g: <Counter(Line)>
m ng

<CountryExtraTaxDescription>
Returns the extra tax's description for the current Company's login country/region.
E.g: <CountryExtraTaxDescription>
i
om in

<CountryExtraTaxDescriptionNotRecoverable>
Returns the extra tax's description for the current Company's login country/region + ' Not Recoverable'
C a

phrase.
E.g: <CountryExtraTaxDescriptionNotRecoverable>
Tr

<CountryExtraTaxDescriptionRecoverable>
Returns the extra tax's description for the current Company's login country/region + ' Payable / Recoverable'
phrase.
E.g: <CountryExtraTaxDescriptionRecoverable>

<CreditOnHold(BusinessObject)>
Check if a business object is in credit on hold status. If no parameter is passed in it will do the checking on
on

the primary data provider of the document.


E.g: <CreditOnHold()>
E.g: <CreditOnHold(Consignee)>
N

<Currency({decimalamount},{currencycode})>
Formats the cell inserting the decimal amount as the value and setting the right number of decimal places for
the currency specified. Please note that the currency code itself is NOT included in the output.
E.g: <Currency(4.5, USD)>
E.g: <Currency(<Amount>, <CurrencyCode>)>

<CurrencyLanguageName({currencycode},{languagecode})>
Get currency name from language code.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 15 of 39
E.g: <CurrencyLanguageName(USD, ZH-CN)>
E.g: <CurrencyLanguageName(<CurrencyCode>, ZH-CN)>

<CurrencyMajorUnit({currency code})>
For a given currency, returns its major unit.
E.g: <CurrencyMajorUnit(USD)>

<CurrencySubUnitFormat({currency code})>
For a given currency, returns its format.
E.g: <CurrencySubUnitFormat(USD)>

<CurrencyToWords({decimalamount},{currencycode}[,{outputlanguagecode} [,{numberformat}]])>
Inserts the decimal value expressed as words appropriate for the language and currency specified. Defaults
to the language of the document, if supported, or you can specify a language using the optional third
parameter.

ly
You can also specify an optional fourth parameter to specify the special number format the amount should
be shown in. Currently this function supports South Asia Lake Crore Format, and it will only be effective

on
when the language code is ENG.
Decimal values are shown as numbers by default and can be shown as words by specifying LTR in the
macro.
E.g: <CurrencyToWords(1.5,USD)>

U t
E.g: <CurrencyToWords(<Charges.Value>, <Charges.CurrencyCode>,ZH-CN)>

al s
se
E.g: <CurrencyToWords(<Charges.Value>, <Charges.CurrencyCode>, ENG, SAF)>
ci Te
E.g: <CurrencyToWords(<Charges.Value>, <Charges.CurrencyCode>, AR-AE, LTR)>

<CurrentBranch>
Returns the PK for the Current Branch (GlbBranch) the current user is logged into.
er /
E.g: <CurrentBranch>
m ng

<CurrentCompany>
Returns the PK for the Current Company (GlbCompany) the current user is logged into.
E.g: <CurrentCompany>
i

<CurrentCountryTaxRegistrationOrgCusCode>
om in

returns Current Company's registered Consumption Tax code.


E.g: <CurrentCountryTaxRegistrationOrgCusCode>
C a

<CurrentDepartment>
Tr

Returns the PK for the Current Department (GlbDepartment) the current user is logged into.
E.g: <CurrentDepartment>

<CurrentPage[({StartingPageNumber})]>
Returns the current page number, optionally offset with the starting page number.
See also: TotalPages.
E.g: <CurrentPage>
E.g: <CurrentPage(5)>
on

<CurrentPeriod>
Returns the Current Period for the Current Company (GlbCompany) the current user is logged into.
N

E.g: <CurrentPeriod>

<CustomisedColumn({columnname})>
Returns the value for the Customized Column specified by the column name.
E.g: <CustomisedColumn(ShoeSize)>

<CustomsCode({orgheaderpk},{countrycode},{typecode})>
Returns a specific customs code for a given organization.
E.g: <CustomsCode(<OrgPK>, AU, GST)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 16 of 39

<DatabaseName>
Returns the name of the database containing the CargoWise One data on your SQL Server.
E.g: <DatabaseName>

<DatabaseServer>
Returns the name of the SQL Server currently storing your CargoWise One database.
E.g: <DatabaseServer>

<DataMatrix("{InputText}",{WidthInColumns},{HeightInRows})>
Returns a DataMatrix code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
- HeightInRows: Number of rows to span in Excel.
E.g: <DataMatrix("<BarCodeText>", 2, 4)>

ly
<DateDiff("startDate", "endDate", "unitType")>
Returns the time between the two dates in the specified unit, rounded down to a whole number.

on
E.g: <DateDiff("2023-02-22", "2023-02-25", "DAYS")>
E.g: <DateDiff("2016-12-20 4:00 PM", "2016-12-21 1:00 AM", "HOURS")>
E.g: <DateDiff("March 01 2008 7:44 PM", "2008-03-01 9:56 PM", "MINUTES")>
E.g: <DateDiff("14-07-2026 22:10:44", "14-07-2026 22:10:16", "SECONDS")>

U t
al s
se
<DateTimeAsString('{DateValue}', '{DateFormatString}' [,Calendar:{CalendarInfo}]
[,{ConvertFromUtcToLocal}])> ci Te
Is used to format a date value using a C# style formatting string. (i.e: dd-MMM-yy hh:mm:ss etc.)
Most things that work when formatting an excel cell with a customized date format will work as a format
string with this function too.
er /
Pre-defined Date Format Strings:
m ng

- ShortDateFormat
- ShortTimeFormat
- LongTimeFormat
i

Optional Parameters:
om in

Calendar:CalendarInfo is a Microsoft JScript statement that if is evaluated to True will convert the Date
Value from Universal Time to Local Time.
C a

E.g: <DateTimeAsString('08/08/2007 11:15:30', 'LongTimeFormat', 1==1)>


E.g: <DateTimeAsString('08/08/2007 11:15:30', 'ShortDateFormat')>
Tr

E.g: <DateTimeAsString('<Now>', 'LongTimeFormat')>


E.g: <DateTimeAsString('19/04/2020 11:15:30', 'ShortDateFormat', 'Calendar:GregorianCalendar')>
E.g: <DateTimeAsString('19 Oct 2004', 'yyyy, MM/dd hh:mm')>
E.g: <DateTimeAsString('<DateTimeStart>', 'dd-MMM-yy hh:mm:ss')>

<DateTimeStart>
Returns the starting Date/Time when the Report or Document is generated.
E.g: <DateTimeStart>
on

<Delimit("{FirstValue}", "{DelimitingValue}", "{SecondValue}")>


If {FirstValue} and {SecondValue} are both not empty, returns both values with the {DelimitingValue} in
N

between. If just one has a value, returns the non empty value, otherwise returns a blank string.
E.g: <Delimit("<CurrentPage>", " of ", "<TotalPages>")>

<DeliveryCount>
Returns the number of times this document has been delivered.
E.g: <DeliveryCount>

<DeliveryMode>
This macro returns the 'Type' in 'Templates Used', which is the delivery medium used for that template, for
05-Jan-24 DOCUMENTENGINE REFERENCE Page 17 of 39
example either the printer, email or fax.
E.g: <DeliveryMode>

<DescriptionFromCode({codetype},{code} [,{fallback}])>
Gets a description for the specified code using the code type to obtain the correct list of codes/descriptions.
Currently the only code types supported are 'JobServices' and 'VoyageAccountingSubGroups' which reads
from a user definable list of available Job Services and Voyage Accounting Sub Groups in the Registry.
An optional fallback can be provided for cases where the code does not exist in the specified list.
E.g: <DescriptionFromCode(VoyageAccountingSubGroups, POC)>
E.g: <DescriptionFromCode(VoyageAccountingSubGroups, AAA, Fallback)>

<Divide("{value1}","{value2}",...)>
Will do the division of two or more values.
E.g: <Divide("<TotalOSAmount>", "<OSOutstandingAmount>", "<OSOutstandingAmount>")>

ly
<DocumentClosing({fieldname1}[ {fieldname2}[ {fieldname3}]...] [, {modePrefix}])>
Reads the Document Closing Text from the CargoWise One registry settings for Document Closing Texts.

on
There are settings for each style of document in the registry under 'Documents', and a fallback closing text in
'Documents\Default Closing Text'. Unlike most function based macros, this function accepts field names only
as parameters (separated by spaces with no surrounding angle brackets).
This means you cannot pass in text literals at this point.

U t
The best way to work out how to use this function is to find a document that is showing the text you want to

al s
se
show on yours and implement your usage the same way.
ci Te
E.g: <DocumentClosing(LEVEL ReportName)>
E.g: <DocumentClosing(TransportStatus Note, TransportMode)>

<DocumentCustomLabel({customfieldname},{defaultlabeltext})>
er /
This functionality is used when Custom Labels are defined on the Organization the document is being
produced for. Falls back to the Company Organization Proxy to find the Custom Label if not found. If no
m ng

Custom Label is found for the specified custom field name, the default label text is used.
E.g: <DocumentCustomLabel(CustomText1, PalletType)>

<DocumentOpening({fieldname1}[ {fieldname2}[ {fieldname3}]...] [, {modePrefix}])>


i

Reads the Document Opening Text from the CargoWise One registry settings for Document Opening Texts.
om in

There are settings for each style of document in the registry under 'Documents', and a fallback opening text
in 'Documents\\Default Opening Text'. Unlike most function based macros, this function accepts field names
C a

only as parameters (separated by spaces with no surrounding angle brackets).


This means you cannot pass in text literals at this point.
Tr

The best way to work out how to use this function is to find a document that is showing the text you want to
show on yours and implement your usage the same way.
E.g: <DocumentOpening(LEVEL ReportName)>
E.g: <DocumentOpening(TransportStatus Note, TransportMode)>

<DurationAsDateTime({duration})>
Takes a duration and returns a DateTime in the format required to set duration fields. Expected Input format:
"HHH:MM" where MM < 60.
on

E.g: <DurationAsDateTime("2:45")>

<DutyRate({businessobjecttype},{businessobjectpkasguid})>
N

Will return the Import Duty Rate from the specified business object type. Valid types: OrgSupplierPart,
CusClassification, CusClassPartpivot, CusClassPartpivotTax. You will need to have the PK for the relevant
business object for a value to be returned.
E.g: <DutyRate(CusClassification, <InvoiceLine.JI_OP>)>

<EAN-13("{InputText}",{WidthInColumns},{HeightInRows})>
Returns a EAN-13 code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
- HeightInRows: Number of rows to span in Excel.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 18 of 39
E.g: <EAN-13("<BarCodeText>", 2, 4)>

<EAN-8("{InputText}",{WidthInColumns},{HeightInRows})>
Returns a EAN-8 code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
- HeightInRows: Number of rows to span in Excel.
E.g: <EAN-8("<BarCodeText>", 2, 4)>

<EmailSenderOverride>
Returns the report's email sender override address, or an empty string if no override exists.
E.g: <EmailSenderOverride>

<EnterpriseInformation.{Property})>
This macro is used to access various information about the CargoWise One application.
Available properties are

ly
VersionNumber,ComplianceVersionNumber,VersionDate,VersionDateForReport,DBVersionNumber,Termina
lServerMode,DBServerName,DBDatabaseName,CurrentCompanyName,CurrentCompanyCountry,SystemD

on
ocumentsVersion,ClientDocumentsName,ClientDocumentsVersion,FrameworkVersion,Release,LicenceCod
e,SqlServerVersion,SystemLicenceType,DatabaseSecurityMode.
E.g: <EnterpriseInformation.DBServerName>

U t
<EquivalentComplianceSubTypeCode({Compliancesubtype})>

al s
se
Inserts the Compliance Sub Type value. This function returns the Government Authority equivalent code of
the compliance sub type. ci Te
E.g: <EquivalentComplianceSubTypeCode(TXA)>
E.g: <EquivalentComplianceSubTypeCode('TXA')>
er /
<EvaluateInnerContent("{stringcontainingmacrostoevaluate}")>
Evaluates inner content, expands properties/macros.
m ng

E.g: <EvaluateInnerContent("<Z0_NVarchar> <CustomsCode(<BranchProxy>, NZ, XYZ)>")>

<ExcelFormula({stringContainingExcelFormulaToCalculate})>
The string content inside the macro will be treated as excel formulas and will be calculated after replacing.
i

Note: This macro only support default excel formulas.


om in

E.g: <ExcelFormula("= AVERAGE(3,1,5)")>


E.g: <ExcelFormula("= (2 + 2)/2")>
C a

<ExchangeRate({exchangeratedecimalvalue})>
Tr

Will format the supplied exchange rate with the right number of decimal places depending on what 'Is
Reciprocal Exchange Rate' is set to on the Current Company.
E.g: <ExchangeRate(<ExRate>)>

<ExpandToFit[({RowToExpand})]>
Used as a prefix to a subsequent macro.
If the value inserted by the subsequent macro won't fit in the cell in the template, the row height will be
progressively expanded until it will fit.
on

The {RowToExpand} parameter is used to determine if the first or last row of a range of merged cells should
be expanded.
If {RowToExpand} parameter is not specified, the first row in a merged cell will expand.
N

This macro can not be used with the <ShrinkToFit> or <AutoHeight> macros.

This macro will not work if it is used together with TFormula macro (<AccumulativeTotal {fieldname}> or
<AccumulativeTotalWithReset {fieldname}>,<Total {fieldname}>).

E.g: <ExpandToFit><ShipmentNumber>
E.g: <ExpandToFit(First)><ShipmentNumber>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 19 of 39
E.g: <ExpandToFit(Last)><ShipmentNumber>

<FallbackIfEmpty("{Macros}","{FallbackWithMacros}")>
Gets the value of Macros and displays them unless empty or zero. If Macros results in an empty string or
zero, FallbackWithMacros is evaluated and displayed instead. Macros can contain macros or a string, but if
Macros contains a string the fallback will never be used. The result of Macros is Trimmed to remove spaces
before checking if it is empty.
E.g: <FallbackIfEmpty("<Z0_VarCharMax><Z0_Number>","Text, <Z0_Fallback>")>

<FirstDayOfLastWeek>
Returns a date time value representing the first day of last week starting from the current date and time.
See also: LastDayOfLastWeek.
E.g: <FirstDayOfLastWeek>

<FormatCanadianTaxRate({RateType}, {Rate})>

ly
Return the formatted Canadian tax rate for a given rate type, i.e. V(valorem) or S(specific).
Other rate types are formatted as S(specific)

on
E.g: <FormatCanadianTaxRate(<RateType>, <RateValue>)>

<FormatJobDocAddress({JobDocAddressPK} [,{HideCountryIfSame}])>
Returns a formatted address for the specified address including the company name.

U t
{JobDocAddressPK} is the PK of a Doc Address (JobDocAddress) you want to get the address from.

al s
se
Optional Parameters: ci Te
{HideCountryIfSame} is a Microsoft JScript statement that if is evaluated to True will hide the Country in the
address if it's the same with the Sender's Company Country.
E.g: <FormatJobDocAddress(Header.JobDocAddressID)>
er /
E.g: <FormatJobDocAddress(Header.JobDocAddressID , '<TransportMode>'=='SEA')>
m ng

<FormatNumber({value},{currency code})>
Will format the supplied numeric value with respect to the login company's culture number format settings.
Replace {currency code} with a positive integer to force the number of decimals,
or a negative integer to decide the number of decimals based on the current login company's reciprocal
i

nature.
om in

Note: this macro will return a formatted representation of the number as a STRING and will be treated as
C a

such by Excel. It won't be usable for calculation in Excel.


If you just need the value to respect the number of decimals from the currency and want to do calculation
Tr

with it, use the <Currency(...)> macro instead.


E.g: <FormatNumber(<Amount>, <CurrencyCode>)>
E.g: <FormatNumber(<Amount>, <DecimalPlaces>)>
E.g: <FormatNumber(12412351.33, 1)>

<FormatOrgAddress({OrgAddressPK} [,{HideCountryIfSame}])>
Returns a formatted address for the specified address including the company name.
{OrgAddressPK} is the PK of an Address (OrgAddress) you want to get the address from.
on

Optional Parameters:
{HideCountryIfSame} is a Microsoft JScript statement that if is evaluated to True will hide the Country in the
N

address if it's the same with the Sender's Company Country.


E.g: <FormatOrgAddress(Header.OrgAddressID)>
E.g: <FormatOrgAddress(Header.OrgAddressID , '<TransportMode>'=='SEA')>

<FormatPhoneNumber("{phoneNumber}","{format}")>
Transforms a phone number into a specific format.
- phoneNumber: The phone number.
- format: The format of the phone number. Value can be E164, INTERNATIONAL or NATIONAL.
Note: the original phone Number will be returned if the transformation fails.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 20 of 39
E.g: <FormatPhoneNumber("+61 426 829 924","E164")>
E.g: <FormatPhoneNumber("+61 426 829 924","INTERNATIONAL")>
E.g: <FormatPhoneNumber("+61 426 829 924","NATIONAL")>

<FreightChargeCode>
Returns a GUID value representing the Freight Charge Code from the registry.
E.g: <FreightChargeCode>

<GetAccountingControllerID({transactiontype},{ledger})>
Returns the Controller ID when provided a transaction type and ledger.Returns empty string if transaction
type and ledger combination is not valid.
E.g: <GetAccountingControllerID(INV, AP)>

<GetBusinessObjectNumericValueWithZeroAsEmpty({businessobjecttype},{pk},{property})>
Works identically to the GetBusinessObjectValue macro but returns a blank string if the value is equal to

ly
zero. Please note that this will throw an exception (break badly) if you try and specify a non numeric
property.

on
E.g: <GetBusinessObjectNumericValueWithZeroAsEmpty(CusEntryHeader, <EntryHEader.CH_PK>,
CustomsValue)>

<GetBusinessObjectValue({businessobjecttype},{pk},{property})>

U t
If you know the type of business object you want data from and the PK required to load it, you can access

al s
se
any property you like from the associated Document Wrapper even if you're writing a report.
ci Te
Available types: CusEntryHeader (DocBaseCusEntryHeader), JobComInvoiceLine
(DocBaseJobComInvoiceLine), JobDeclaration (DocBaseJobDeclaration), ARInvoice (DocARInvoice).
Generally this functionality is only used in Reports (not Documents) as Document Wrappers already give
direct access to most related and child business objects.
er /
E.g: <GetBusinessObjectValue(JobComInvoiceLine, <EntryHeader.CH_PK>, LineNo)>
m ng

<GetCategoriesForReport({ReportType})>
Returns the Report Categories from the Registry item 'User Define Reports Setup', this registry item can be
found at Accounting -> Reports Setups -> User Define Reports Setup.
E.g: <GetCategoriesForReport("TT0")>
i
om in

<GetCategoryDescForReport({ReportCategory},{ReportType})>
Returns the Report Category description from the Registry item 'User Define Reports Setup', this registry
C a

item can be found at Accounting -> Reports Setups -> User Define Reports Setup.
E.g: <GetCategoryDescForReport("A01","TT0")>
Tr

<GetCurrentManagerCodeByType({staff_pk},{manager_type})>
Returns the staff code of the manager with the specified type for the provided staff PK.
E.g: <GetCurrentManagerCodeByType("2032CF10-385B-4555-BB3F-CEC65A24F61D","DRM")>

<GetCustomField({CustomFieldName})>
Returns the value stored in a customized field on an element.
on

<GetCustomFieldCodeDescription({CustomFieldName})>
Returns the description of a value stored in customized field on an element.
N

<GetCustomFieldCodeDescriptionWithType({CustomFieldName}, {CustomFieldType})>
Returns the description of a value stored in customized field of a specific type on an element.

<GetCustomFieldWithType({CustomFieldName}, {CustomFieldType})>
Returns the value stored in a customized field of a specific type on an element.

<GetEventLastDateTime({EventCode})>
Returns last occurrence date of event with specified event code (ignores estimated and canceled events). If
there is no such event, empty string is returned.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 21 of 39
E.g: <GetEventLastDateTime(Z00)>

<GetFirstPeriodByYear({Period})>
Return the first period of year in which Period is located
E.g: <GetFirstPeriodByYear(202310)>

<GetGeography("{ShapeName}", "{ShapeType}")>
This macro will return the geography defined under Location --> Geography.
The parameter {ShapeName} is the name of the shape as defined in the Geography module.
The parameter {ShapeType} is the geography type of the shape as defined in the Geography module.
E.g: <GetGeography("SCOTLAND", "UKN")>

<GetGuidByOrgCode({orgCode})>
Returns the primary key of the given organization code.
E.g: <GetGuidByOrgCode("ABCDE")>

ly
<GetLocalAccountNumberByPKLanguageCountry({PK},{language},{country})>

on
Returns Local-Account-Number by PK and language and country. If Local-Account-Number is null then
return 'ERR'
E.g: <GetLocalAccountNumberByPKLanguageCountry(36161720-BCCE-45B4-9FEF-F94E23C97E0E,
ZH-CN, CN)>

U t
al s
se
<GetPeriodEndDateByPeriod({period})>
ci Te
Returns the period end date of the given period in current company.
E.g: <GetPeriodEndDateByPeriod("ABCDE")>

<GetPropertyFromEntity({entityName},{pk},{property})>
er /
Returns a property from the entity only a limited set of entities are supported.
E.g:
m ng

<GetPropertyFromEntity("GlbStaffHoliday","2032CF10-385B-4555-BB3F-CEC65A24F61D","GA_ApprovalS
tatus")>

<GetShowEditFormUrl({controllerid},{businessobjectpk})>
i

Returns a clickable link (URL) that will allow the consumer of the resulting document to click through to the
om in

form for the Business Object indicated by the Controller ID and Business Object PK specified.
The link will only work on machines connected to your local network that are able to log into CargoWise One
C a

and the user will have to have security privileges to the form indicated by the Controller ID.
If you want a link external contacts can use, try using the GetTrackingUrl macro instead.
Tr

E.g: <GetShowEditFormUrl(JobConsol, <PK>)>


E.g: <GetShowEditFormUrl(Organisation, <Creditor.PK>)>

<GetStaffValueForPerson({applicantPk}[, {fieldname}])>
Returns the staff PK of the person related to the on-boarding applicant.
E.g: <GetStaffValueForPerson(2032CF10-385B-4555-BB3F-CEC65A24F61D, GS_LoginName)>

<GetTrackingUrl({recipientcontactpk},{webtrackingobjecttype},{webtrackingobjectpk})>
on

Returns a clickable link (URL) that will allow the consumer of the resulting document to click through to the
Web Tracking page for the Tracked Item indicated by the Tracking Object Type and Tracking Object PK
specified.
N

The link will work on any machine that is connected to the Internet and will pass them through to the
appropriate page on your Web Tracking website.
If you want a link for internal use navigating directly into CargoWiseOne itself, try using the
GetShowEditFormUrl macro instead.
E.g: <GetTrackingUrl(<Contact.OC_PK>, Booking, <Booking.EB_PK>)>

<GetTranslatedAddress({AddressPK},{LanguageCode}[,{AddressComponent}])>
Returns the address in the specified language.
{AddressPK} is the PK of the Address (OrgAddress) you want to get the translation from.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 22 of 39
{LanguageCode} is the ISO language code or the constant string 'DocumentLanguage'.
Using 'DocumentLanguage' should return a translated address based on the language of the document
being generated.
The original value will be returned if the address does not have a linked translated address in the specified
language.
Optional Parameters:
{AddressComponent} is an address component name. If it is used, the macro will retrieve and return only
one component from the address.
Address component list: CompanyName, AddressLine1, AddressLine2, City, State, PostCode.
E.g: <GetTranslatedAddress(<AddressPK>, ZH-CN)>
E.g: <GetTranslatedAddress(<AddressPK>, DocumentLanguage, AddressLine1)>

<GetUserEmailWhoRaisedEvent("{eventCode}","{eventReference}"[,"{businessObjectPk}"])>
Returns the email address of the user who created the most recent actual event that is not canceled. It also
meets the following criteria.

ly
- eventCode: The code of the event.
- eventReference: The reference text of the event. "*" and "?" wildcards are supported.

on
- businessObjectPk (optional): The primary key of the business object whose events should be searched. If it
is empty or not provided, The primary key of the primary data provider of the document will be used.
E.g: <GetUserEmailWhoRaisedEvent("ADD","Confirmed*")>
E.g: <GetUserEmailWhoRaisedEvent("ICL","Confirmed*", "<JS_PK>")>

U t
al s
se
<GroupCount({tablename},{fieldname}[,{logicalExpression}])>

expression supports:
ci Te
Returns the number of groups that will be created if you group by the specified table and field. The logical

Logical Operators: AND (&&) and OR (||)


Relational Comparison: EQUALS (==) and NOT EQUALS (!=).
er /
Any field that is text requires "" to be placed around the property.
E.g: <GroupCount(Lines, GST, "<GST>"=="5" && "<Currency>"=="AUD")>
m ng

E.g: <GroupCount(Lines, GST)>

<GroupCurrentPage({GroupByField})>
Gives the current page of the group.
i

See also GroupTotalPages


om in

E.g: <GroupCurrentPage(GST)>
C a

<GroupIndex>
Gives the Index of the current group.
Tr

E.g: <GroupIndex>

<GroupTotalPages({GroupByField})>
Gives the total pages count of the group.
See also GroupCurrentPage.
E.g: <GroupTotalPages(GST)>

<HasEvent(EventCode)>, <HasEvent(BusinessObject,EventCode)>
on

Checks if a business object has an event of specified event code occurred. (Neither Cancelled nor
estimated). It will return "Y" if event log exists, otherwise "N".
If only event code is provided, it will do the checking on the primary data provider of the document.
N

E.g: <HasEvent (EMS)>


E.g: <HasEvent (Consignor, EMS)>

<HasValidGeneralLedgerData({CompanyPK},{StartPeriod},{StartDate})>
If you are running report from EDW, you must make sure that backlog accounting transactions have been
completely processed. Please check the Journal Entries Last Processed Date registry if you can't run report
E.g: <HasValidGeneralLedgerData(36161720-BCCE-45B4-9FEF-F94E23C97E0E, 202304, )>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 23 of 39
<HideRowIf({evaluatableexpression})>
This macro returns no value, but will cause the Document Engine to set the height of the current row to 0
(hides the row) if the expression specified evaluates to true.
Please note that we might get some extra blank lines when some macros are used together with this macro.
E.g: <HideRowIf(<TotalPages> == 2)>
E.g: <HideRowIf(<CurrencyMajorUnit(USD)> == "dollar")>
E.g: <HideRowIf(<DeliveryCount> == 3)>
The Document Engine uses Microsoft JScript to evaluate the expressions, so any JScript expressions that
evaluate to a boolean result will work, with the exception of 'greater than' or 'less than':
To do 'greater than' use '&gt;' instead of '>'.
To do 'greater than or equals to' use '&gt;=' instead of '>='.
To do 'less than' use '&lt;' instead of '<'.
To do 'less than or equals to' use '&lt;=' instead of '<='.

ly
This macro will not work if it is used together with TFormula macro (<AccumulativeTotal {fieldname}> or
<AccumulativeTotalWithReset {fieldname}>,<Total {fieldname}>).

on
E.g: <HideRowIf(<CurrentPage> == 1)>
E.g: <HideRowIf(<CurrentPage> &gt; 5)>

U t
E.g: <HideRowIf("<Importer.Name>" != "")>

al s
se
<HideRowIfCellIsEmpty> ci Te
This macro returns no value, but will cause the Document Engine to set the height of the current row to 0
(hides the row) if the rest of the contents of the cell are empty.
Designed to be used in conjunction with a following macro. This means that if <Importer.Fax> was empty
er /
the example shown below would cause the whole row it was on to be hidden.
m ng

This macro will not work if it is used together with TFormula macro (<AccumulativeTotal {fieldname}> or
<AccumulativeTotalWithReset {fieldname}>,<Total {fieldname}>).
i

E.g: <HideRowIfCellIsEmpty><Importer.Fax>
om in

<HPageBreak>
C a

Inserts a horizontal page break marker. Will cause the Document Engine to start a new page with the next
row.
Tr

E.g: <HPageBreak>

<Html("{text}", true|false)>
Allows HTML rendering, with option to indicate whether to evaluate the inner macros.
Currently only supports these tags:
<b> or <strong> - Bold.
<i> or <em> - Italics.
<u> - Underline.
on

<s> or <strike> - Strikeout.


<sub> - Subscript.
<sup> - Superscript.
N

<tt> - Use monospace font.


<pre> - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be
kept.
<font> - Change the used font. This tag behaves as normal HTML, and you can specify color, face,
point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24,
34 for each size. You can also specify relative sizes (for example -1)</item>.
<h1>..<h6> - Header fonts.
<small> - Use a smaller font. This is equivalent to <font size = '-1'>.
<big> - Use a bigger font. This is equivalent to <font size = '+1'>.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 24 of 39
Font Color supported:
Color code in six-digit form (#rrggbb), but only those converted from three-digit RGB notation (#rgb) by
replicating digits can be displayed correctly in excel.
e.g. #550055 is correct but #500050 is not.
Color name:
black green silver lime gray olive white yellow maroon navy red blue purple teal fuchsia aqua.
The default format of the font is Arial 9 pt.
E.g: <Html("<pre><font color="#0f0">Interface ITest</font></pre>", false)>
E.g: <Html("<DbField>", true)>

<HtmlEx("{Html}", True|False)>
Allows HTML rendering, with option to indicate whether to evaluate the inner macros.
The cell will be expanded to fit the HTML if required.

Currently only supports these tags:

ly
<b> or <strong> - Bold.
<i> or <em> - Italics.

on
<u> - Underline.
<s> or <strike> - Strikeout.
<sub> - Subscript.
<sup> - Superscript.

U t
<tt> - Use monospace font.

al s
se
<pre> - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be
kept. ci Te
<font> - Change the used font. This tag behaves as normal HTML, and you can specify color, face,
point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18,
24, 34 for each size. You can also specify relative sizes (for example -1)</item>
er /
<h1>..<h6> - Header fonts.
<small> - Use a smaller font. This is equivalent to <font size = '-1'>.
m ng

<big> - Use a bigger font. This is equivalent to <font size = '+1'>.

Font Color supported:


Color code in six-digit form (#rrggbb), but only those converted from three-digit RGB notation (#rgb) by
i

replicating digits can be displayed correctly in excel.


om in

e.g. #550055 is correct but #500050 is not.


C a

Color name:
black green silver lime gray olive white yellow maroon navy red blue purple teal fuchsia aqua.
Tr

The default format of the font is Arial 9 pt.


E.g: <HtmlEx("<pre><font color="#0f0">Interface ITest</font></pre>", false)>
E.g: <HtmlEx("<DbField>", true)>

<If({LogicalTest}, "{ValueIfTrue}", "{ValueIfFalse}")>


This macro evaluates the expression in {LogicalTest} and returns {ValueIfTrue} or {ValueIfFalse} depending
on the result.
on

The Document Engine uses Microsoft JScript to evaluate the {LogicalTest}, so any JScript expressions that
evaluate to a boolean result will work.
with the exception of greater than or less than.
N

To do 'greater than' use '&gt;' instead of '>'.


To do 'greater than or equals to' use '&gt;=' instead of '>='.
To do 'less than' use '&lt;' instead of '<'.
To do 'less than or equals to' use '&lt;=' instead of '<='.
E.g: <If(<CurrentPage>&gt;2, "other pages", "page 1 to 2")>
E.g: <If(<CurrentPage>&lt;=1, "page 1", "some other page")>

<Image({imagetype}, {heightinrows}, {widthincolumns}, {isAspectRatioLocked})>


Will cause an image of the type specified to be inserted from the CargoWise One registry scaled to fill the
05-Jan-24 DOCUMENTENGINE REFERENCE Page 25 of 39
number of rows and columns specified in the second and third parameters.
If isAspectRatioLocked is 'Y' then the image will maintain it's original aspect ratio within the bounds of the
rows/columns set.
Available image types: CompanyLogo, ChequeLogoWithBankDetail, HBLLogo, HAWBLogo, ChequeLogo.
E.g: <Image(COMPANYLOGO, 2, 4, Y)>

<IntendedRecipientAddress[({pkOfIntendedRecipientOrgAddressRecord})]>
Returns the Postal Address of the Contact the Report or Document is supposed to be sent to without an
'ATTENTION:' prefix showing the Contact Name it's being sent to. When the current companies
country/region is Icelandic and the contacts organization has a Kennitala, 'Kennitala' for non-Icelandic
debtors or 'Kennitala greiðanda' for Icelandic debtors is display beneath the address should the debtor have
entered a Kennitala..
E.g: <IntendedRecipientAddress>
E.g: <IntendedRecipientAddress(<AddressPK>)>

ly
<IsDocumentCustomLabelHidden({customlabelname},{defaultreturnvalue})>
Returns a boolean value which is the opposite of the default return value if the Custom Label is not defined

on
on the Organization associated with the Document. The default return value is always either 'Y' or 'N'.
E.g: <IsDocumentCustomLabelHidden(OrderHeader.CustomDate2, Y)>

<IsDraft>

U t
Returns a value that indicates whether this document is a draft.

al s
se
E.g: <IsDraft>

<IsFunctionalityValid(Code)>
ci Te
Returns Y if the functionality indicated by the 'Code' is valid or enabled for the current logged in company,
and returns N otherwise.
er /
E.g: <IsFunctionalityValid(Code)>
m ng

<IsPointInShape({GeographyPoint}, {GeographyPolygon})>
This macro takes geography values and will return true if the {GeographyPoint} is within the
{GeographyPolygon}.
This can be used inside the IF Macro to present different values depending on the location.
i

E.g: <IsPointInShape(<GetConsigneeDocAddress.E2_GeoLocation>, <GetGeography("Scotland",


om in

"UKN")>)>
E.g: <IsPointInShape(<GetConsigneeDocAddress.E2_GeoLocation>, <GetGeography("England",
C a

"UKN")>)>
Tr

<IsProductionSystem>
Returns a value that indicates whether the current system is a production system as opposed to a
test/training system.
E.g: <IsProductionSystem>

<IsReportCustomLabelHidden({customlabelname},{defaultreturnvalue})>
Returns a boolean value which is the opposite of the default return value if the Custom Label is not defined
on the Organization associated with the Report. The default return value is always either 'Y' or 'N'.
on

E.g: <IsReportCustomLabelHidden(OrderHeader.CustomDate2, Y)>

<IsRunReportFromEDW>
N

If user click on "Use EDW as Report Data Source" when running reports, the result will be "Y" otherwise the
result will be "N".
E.g: <IsRunReportFromEDW>

<KeyedCodePairValue({provider},{field},{index},{Key})>
Returns the field value(s) (code or description) from specified value pair provider's element with specified
index.When {index} equals 'All', returns comma-separated list of all values. {index} is 1-based or string Code.
E.g: <KeyedCodePairValue(dynamicorderheaderstatus, Code, 1, <Key>)>
E.g: <KeyedCodePairValue(dynamicorderheaderstatus, Description, INC, <Key>)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 26 of 39

<LandedCostingPreference({lcgroupid})>
Returns the Landed Costing Group name from the CargoWise One registry settings. The lcgroupid can be a
numeric value from 1 to 6 relating to the 6 configurable groups in the Landed Costing registry settings.
E.g: <LandedCostingPreference(1)>

<LanguageFromCode({code})>
Returns the description of a language when passed a valid language code.
E.g: <LanguageFromCode(EN-US)>

<LastDayOfLastWeek>
Returns a date time value representing the last day of last week starting from the current date and time.
See also: FirstDayOfLastWeek.
E.g: <LastDayOfLastWeek>

ly
<Left("{text}", {length})>
Returns the leftmost characters from within the supplied string up to the maximum length specified.

on
E.g: <Left("<OH_FullName>", 4)>

<LocalBusinessNumber({orgheaderpk})>
Returns the local Business Registration Number of the Organization represented by the orgheaderpk.

U t
E.g: <LocalBusinessNumber(<OH_PK>)>

al s
se
<LoginCode> ci Te
Gets the Short Code (usually initials) of the current user logged into CargoWise One.
E.g: <LoginCode>
er /
<LoginEmail>
Gets the Email Address of the current user logged into CargoWise One.
m ng

E.g: <LoginEmail>

<LoginFaxNumber>
Gets the Fax number of the current user logged into CargoWise One.
i

If the current logged in user does not have a work Fax number entered or it is not set as published, then fall
om in

back to the branch/company Fax number.


E.g: <LoginFaxNumber>
C a

<LoginFullName>
Tr

Gets the Full Name of the current user logged into CargoWise One.
E.g: <LoginFullName>

<LoginName>
Gets the Login Name the current user typed in to log into CargoWise One.
E.g: <LoginName>

<LoginPhoneExtensionNumber>
on

Gets the published phone extension number of the current user logged into CargoWise One.
E.g: <LoginPhoneExtensionNumber>
N

<LoginPhoneNumber>
Gets the phone number of the current user logged into CargoWise One.
If the current logged in user does not have a work phone number entered or it is not set as published, then
fall back to the branch/company phone number.
E.g: <LoginPhoneNumber>

<LoginPK>
Gets the PK of the GlbStaff record for the current user logged into CargoWise One.
E.g: <LoginPK>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 27 of 39

<LoginStaffCertificateNumber({typecode})>
Returns a specific certificate number for the current user.
E.g: <LoginStaffCertificateNumber(PAS)>

<LoginTitle>
Gets the Title of the current user logged into CargoWise One.
E.g: <LoginTitle>

<MacroNameUntranslated>
Returns the untranslated value of <MacroName>.
E.g: <CompanyCountryUntranslated>

<MenuTitle[({Translatable})]>
Returns the document title. An optional parameter will translate the document title from English to the

ly
language used in the document delivery.
Note: Language translation is only supported in DocBuilder documents.

on
E.g: <MenuTitle>
E.g: <MenuTitle(Y)>

<Modifiable({macros})>

U t
Ensures that the macros will be modifiable in visualization as a single field.

al s
se
E.g: <Modifiable(<Z0_VarCharMax>: <Z0_Number>)>
ci Te
<ModifiableField("{fieldidentifier}"[, "{defaultvalue}"])>
Will allow the user to modify the content of the cell where there is no field to base the content on.
You can optionally specify a default value where you want multiple values to make up the basis for one
er /
editable cell. The default value can contain any combination of macros and text where specified.
E.g: <ModifiableField("SignaturePrefix", "Yours Sincerely")>
m ng

<ModuleDescriptionFromCode({licencingmodulecode})>
Gets a description for the specified licensing checkpoint based on the 3 character code passed in as a
parameter.
i

E.g: <ModuleDescriptionFromCode(COR)>
om in

<MultilinePayableAt({loadport},{dischargeport},{incoterm},{chargegroup})>
C a

For each charge group specified, (you can specify multiple charge groups separated by line feeds) this
macro will return either the Load or Discharge port depending on whether the charge group is payable at the
Tr

Origin or the Destination according to the Incoterm supplied. If you specify multiple charge groups separated
by line feeds, multiple UNLOCO's will be returned separated by line feeds.
See also: MultilinePrePaidCharges.
Available Charge Groups:
BRK - Customs Brokerage / Agency / Entry Fees
BON - Customs Brokerage (Stand-alone Brokerage, No Shipment)
CLL - CFS Load List Charges
CSH - CFS Shipment
on

CST - Container Storage and Handling


CDS - Customs Duty / Tax / Entry Fees and other disbursements
DST - Destination
N

FRT - Freight
INS - Insurance
LOD - Loading
NJR - Non-job related charges
NGC - Not grouped
ORG - Origin
OBR - Origin Customs Brokerage
OBO - Origin Customs Brokerage (Stand-alone Brokerage, No Shipment)
SDS - Liner & Agency Disbursements
05-Jan-24 DOCUMENTENGINE REFERENCE Page 28 of 39
TRN - Port Transport Charges
TBC - Transport Booking
TDC - Transit Dispatch
TDU - Transit Dispatch Transportation Unit
TRC - Transit Receive
TRU - Transit Receive Transportation Unit
UNL - Unloading
WAH - Warehouse Ad Hoc Service Job
WIN - Warehouse Receipts
WOU - Warehouse Orders
WST - Warehouse Storage
CYI - Yard Gate In
CYO - Yard Gate Out
CYS - Yard Storage.
E.g: <MultilinePayableAt(<Shipment.Origin>, <Shipment.Destination>, EXW, DST

ly
ORG)>

on
<MultilinePrePaidCharges({isimport},{incoterm},{chargegroup})>
For each charge group specified, (you can specify multiple charge groups separated by line feeds) this
macro will return either 'Prepaid' or 'Collect' depending on whether the charge group is payable at the Origin
or the Destination according to the Incoterm supplied.

U t
If you specify multiple charge groups separated by line feeds, multiple payment types will be returned

al s
se
separated by line feeds.
ci Te
See also: MultilinePrePaidCharges - has full list of available charge groups.
E.g: <MultilinePrePaidCharges(Y, <Inco Term>, DST
ORG)>
er /
<MultilingualAccount({languagecode},{countrycode,},{reportcode},{startorend})>
Returns an account number in the language specified by the language code and country code, for the report
m ng

specified by the 3-character code (P&L - Profit and Loss, BSH - Balance Sheet). Will return either the
starting account number or ending account number depending on whether 'START' or 'END' is specified as
the third parameter.
E.g: <MultilingualAccount(ZH-CN,CN,P&L,START)>
i

E.g: <MultilingualAccount(EN-US,AU,BSH,END)>
om in

<Multiply("{value1}","{value2}",...)>
C a

Will do the multiplication of two or more values.


E.g: <Multiply("<TotalOSAmount>", "<OSOutstandingAmount>", "<OSOutstandingAmount>")>
Tr

<NonModifiable>
Used as a prefix to a subsequent macro. Makes the contents of this cell unable to be modified in
visualization.
E.g: <NonModifiable><InvoiceLine.GoodsDescription>

<Now>
Returns the current system Date and Time as a DateTime value. NB: You'll need to format the cell on the
on

Template to make sure the result is shown in the format you want to see it in.
E.g: <Now>
N

<NumberToWords({decimalnumber}[, "{languagecode}"])>
Represents any integer numeric value in words. Defaults to the language of the document, if supported, or
you can specify a language using the optional second parameter.
E.g: <NumberToWords(11)>
E.g: <NumberToWords(12, ZH-CN)>

<OverCreditLimit({OrganizationPK})>
Check if a organization is over credit limit.
E.g: <OverCreditLimit(<OH_PK>)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 29 of 39

<OverFlowToFollowPage("{fieldtitle}"[[, {maxrowcount}], {Overflowbehaviour}])>


This macro is applied as a prefix to all other macros in the cell, and is applied after all other macros in the
cell have been replaced.
If the replaced contents will not fit within the bounds of the cell, as much information as can be fit will be left
in the cell and the remainder will be shown in a plain paper follow page following the main document.
The text supplied in {fieldtitle} will be used as a title for any text moved to a follow page.
If {rowcount} is included, the cell will be allowed to wrap and expand up to the number of rows defined in
{maxrowcount}. Default value is 1.
The {Overflowbehaviour} can have the following values:
- WrapOverflowWithContinued (default) :- Moves text that will not fit to a follow page and will add a
"(continued...)" at the end of the original cell.
- WrapOverflowWithoutContinued :- Moves text that will not fit to a follow page. Cuts off before the last
character that will not fit.
- MoveAllContentWithContinued :- If too long, moves all text to a follow page and will insert "(continued...)" in

ly
the original cell.
- MoveAllContentWithoutContinued :- If too long, moves all text to a follow page.

on
- MoveAllContentAndKeepOriginal :- If too long, truncate text and then show all text on a follow page.
E.g: <OverFlowToFollowPage("Notes", 25, MoveAllContentWithContinued)><ExpandToFit><Notes>

<PDF417("{InputText}",{WidthInColumns},{HeightInRows}[,"{ErrorCorrectionLevel}","{Charset}"])>

U t
Returns a PDF417 code image that contains the text with the following supplied specifications:

al s
se
- WidthInColumns: Number of columns to span in Excel;
ci Te
- HeightInRows: Number of rows to span in Excel;
- ErrorCorrectionLevel (optional): PDF417 code error correction level (L0, L1, L2, L3, L4, L5, L6, L7, L8,
AUTO);
- Charset (optional): The name of the text character set.
er /
E.g: <PDF417("<BarCodeText>", 2, 4)>
E.g: <PDF417("<BarCodeText>", 2, 4, "L1", "UTF-8")>
m ng

<PLAppropriationAccount>
Returns the PL Appropriation Account defined in the Registry Accounting -> Framework -> PL
Appropriation Account.
i

E.g: <PLAppropriationAccount>
om in

<PostalAddress({companyid})>
C a

Returns a formatted postal address for the specified company including the company name.
{companyid} can either be 'COMPANYCODE' which will return the postal address for the Organization Proxy
Tr

to the Current Company, or it can be the PK of an Organization (OrgHeader) you want to get the postal
address from.
E.g: <PostalAddress(COMPANYCODE)>
E.g: <PostalAddress(Header.BillToID)>

<ProfitShareChargeCode>
Returns the Profit Share Charge Code from the Registry Accounting -> Job Invoicing -> Profit Share ->
Profit Share Charge Code.
on

E.g: <ProfitShareChargeCode>

<QRCode("{InputText}",{WidthInColumns},{HeightInRows}[,{Version}][,"{ErrorCorrectionLevel}"][,"{Ch
N

arset}"][,"Image:{LogoCode}"])>
Returns a QR code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
- HeightInRows: Number of rows to span in Excel;
- Version (optional): QR code version (1-40);
- MarginInPixels (optional): QR code margin in pixels;
- ErrorCorrectionLevel (optional): QR code error correction level (L, M, Q, H);
- Charset (optional): The name of the text character set;
- LogoCode (optional): The code of an image defined in the LogoCode registry setting. This image will
05-Jan-24 DOCUMENTENGINE REFERENCE Page 30 of 39
appear in the center of the QR code.
E.g: <QrCode("<BarCodeText>", 3, 3)>
E.g: <QrCode("<BarCodeText>", 3, 3, 2)>
E.g: <QrCode("<BarCodeText>", 3, 3, 2, 5, "L", "UTF-8")>
E.g: <QrCode("<BarCodeText>", 3, 3, 2, "L")>
E.g: <QrCode("<BarCodeText>", 3, 3, 2, "UTF-8")>
E.g: <QrCode("<BarCodeText>", 3, 3, "UTF-8")>
E.g: <QrCode("<BarCodeText>", 3, 3, "L")>
E.g: <QrCode("<BarCodeText>", 3, 3, "L", "UTF-8")>
E.g: <QrCode("<BarCodeText>", 3, 3, "Image:CRS")>
E.g: <QrCode("<BarCodeText>", 3, 3, "UTF-8", "Image:CRS")>

<RecipientAddress>
Returns the Address of the Contact the Report or Document is supposed to be sent to. An optional
parameter will exclude the Contact name.

ly
E.g: <RecipientAddress>
E.g: <RecipientAddress(AddressOnly)>

on
<RecipientCompanyCode>
Returns the Company Code of the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientCompanyCode>

U t
al s
se
<RecipientCompanyName>
ci Te
Returns the Company Name of the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientCompanyName>

<RecipientContactPK>
er /
Returns the PK of the Contact (OrgContact) the Report or Document is supposed to be sent to.
E.g: <RecipientContactPK>
m ng

<RecipientEmailAddress>
Returns the Email Address of the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientEmailAddress>
i
om in

<RecipientFaxNumber>
Returns the Fax Number of the Contact the Report or Document is supposed to be sent to.
C a

E.g: <RecipientFaxNumber>
Tr

<RecipientName>
Returns the Name of the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientName>

<RecipientNameAndAddress[({IncludeCountryIfSameToCurrent: Y or N} [,{LanguageCode}])]>
Returns the Address of the Contact the Report or Document is supposed to be sent to with an 'ATTN:' prefix
showing the Contact's Name, based on the document's Address Category.
IncludeCountryIfSameToCurrent is optional, if it is not specified, it will be N.
on

LanguageCode is optional, if it is specified, the parameter IncludeCountryIfSameToCurrent must be


specified as well, it will translate the address if it has a linked translated address in the specified language.
LanguageCode is the language code or the constant string 'DocumentLanguage'.
N

Using 'DocumentLanguage' should return a translated address based on the language of the document
being generated.
The original value will be returned if the address does not have a linked translated address in the specified
language.
E.g: <RecipientNameAndAddress>
E.g: <RecipientNameAndAddress(Y)>
E.g: <RecipientNameAndAddress(N, PT-BR)>
E.g: <RecipientNameAndAddress(Y, DocumentLanguage)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 31 of 39
<RecipientNameAndAddressFollowingByContactName>
Returns the Address of the Contact the Report or Document is supposed to be sent to following by
'ATTENTION:' prefix showing the Contact Name it's being sent to, based on the document's Address
Category.
E.g: <RecipientNameAndAddressFollowingByContactName>

<RecipientNameAndIntendedRecipientAddress[({pkOfIntendedRecipientOrgAddressRecord},
{IncludeCountryIfSameToCurrent: Y or N})]>
Returns the Address of the Contact the Report or Document is supposed to be sent to with an 'ATTENTION:'
prefix showing the Contact Name it's being sent to. When the current companies country/region is Icelandic
and the contacts organization has a Kennitala, 'Kennitala' for non-Icelandic debtors or 'Kennitala greiðanda'
for Icelandic debtors is display beneath the address should the debtor have entered a Kennitala.
IncludeCountryIfSameToCurrent is optional, if it is not specified, it will be N.
E.g: <RecipientNameAndIntendedRecipientAddress>
E.g: <RecipientNameAndIntendedRecipientAddress(<AddressPK>, N)>

ly
E.g: <RecipientNameAndIntendedRecipientAddress(<AddressPK> ,Y)>

on
<RecipientPhoneNumber>
Returns the Phone Number of the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientPhoneNumber>

U t
<RecipientSalutation>

al s
se
Returns the Salutation for the Contact the Report or Document is supposed to be sent to.
E.g: <RecipientSalutation>

<RegistryAPPaymentMethod>
ci Te
Returns the AP Bank Account Payment Methods from the Registry Master Data -> Organizations ->
er /
Default Values -> AP Bank Account Payment Methods.
E.g: <RegistryAPPaymentMethod>
m ng

<RegistryItem({registryobjectidentifier})>
Will return registry item values from the object in the Old Style registry (i.e: Env.Registry.property name) or
the New Style registry (i.e: DocumentsDataRegistry.Instance.property name) based on the registry object
i

identifier that you pass in.


om in

E.g: <RegistryItem(Env.Registry.AWBSecurityDeclaration.OpeningText)>
C a

<RegistryItemBusinessObject({registryobjectidentifier}).{Property Name or Function}>


Will allow registry item business objects to be accessed as though it were through a property on a document
Tr

wrapper.
Please note that this will NOT work on old style registry items as they are not based on Business Objects.
E.g:
<RegistryItemBusinessObject(Enterprise.DocumentEngineCore.Registry.DocumentsDataRegistry.Instance.
PrincipalDocumentBrand,Enterprise.DocumentEngineCore).Format("{Code}", Comma)>

<RegistryItemTVP({registryobjectidentifier})>
Will return a SQL Server table valued parameter from registry item values from the object in the Old Style
on

registry (i.e: Env.Registry.property name) or the New Style registry (i.e:


DocumentsDataRegistry.Instance.property name) based on the registry object identifier that you pass in.
This is useful for when you want to access data from a collection in the registry.
N

E.g: <RegistryItemTVP(OrganisationsDataRegistry.Instance.CommissionPeriodList)>

<ReplaceCarriageReturnsWithSpaces("{text}")>
Replaces all carriage returns within the specified text with 3 spaces so that you fit as much of a multi line
field as you can onto one line.
E.g: <ReplaceCarriageReturnsWithSpaces("<Z0_VarCharMax>")>

<ReportCustomLabel({customfieldname}, {defaultlabeltext})>
This functionality is used when Custom Labels are defined on the Organization the report is being produced
05-Jan-24 DOCUMENTENGINE REFERENCE Page 32 of 39
for. Falls back to the Company Organization Proxy to find the Custom Label if not found.
If no Custom Label is found for the specified custom field name, the default label text is used.
E.g: <ReportCustomLabel(CustomText1, PalletType)>

<ReportName>
Returns the localized Report Name from the link record linking the Menu Item and the Template on the
'Customize Documents' form.
See also: <MenuTitle> and <ReportNameUntranslated>.
E.g: <ReportName>

<ReportNameShort>
Returns the Report Name from the link record linking the Menu Item and the Template on the 'Customize
Documents' form, but with any domain specific prefixes like 'Consol' or 'Declaration' or 'Shipment' removed.
See also: ReportName.
E.g: <ReportNameShort>

ly
<ReportTitle>

on
This macro gives the availability to set user defined report titles depend on specific optional sheet or/and
column configuration
E.g: <ReportTitle>

U t
<ScheduledTaskDescription>

al s
se
Returns the S5_ScheduleDescription from the linked StmScheduleTask record when a report is triggered
through scheduling mechanism. ci Te
Otherwise hides entire row that contains the macro.
E.g: <ScheduledTaskDescription>
er /
<SelectedGroupbyOption>
Returns the selected 'Group By' option for Reports.
m ng

E.g: <SelectedGroupbyOption>

<SelectedSortOrder>
Returns the selected 'Sort Order' option for Reports.
i

E.g: <SelectedSortOrder>
om in

<ServerVersion>
C a

Returns the version of the SQL Server the report is running on. Return values are either 2000 or 2005.
E.g: <ServerVersion>
Tr

<SetAndReturnStaffTempPassword({staff_pk})>
Sets and returns the staff temp password which must be reset on first login.
E.g: <SetAndReturnStaffTempPassword(8b6e5deb-5c2b-4529-8c5b-96736e728cc1)>

<ShipmentPrePaidCharges({jobshipmentpk})>
Returns a list of Prepaid Charges for the Shipment (JobShipment) indicated by the PK.
E.g: <ShipmentPrePaidCharges(<JS_PK>)>
on

<ShrinkToFit[({MinimumFontSize})]>
Used as a prefix to a subsequent macro. If the value inserted by the subsequent macro does not fit in the
N

cell in the template, the font size will be progressively reduced until it fits, to the minimum of
{MinimumFontSize}. If no minimum font size is specified, the text will be reduced to a minimum of 8 point.
Note: <ShrinkToFit> Will be ignored if <AutoHeight> is also specified in the same cell or the cell Wrap
Text property is not checked.
E.g: <ShrinkToFit><ShipmentNumber>
E.g: <ShrinkToFit(4.5)><ShipmentNumber>

<ShrinkToFitForBillOfLading[({MinimumFontSize})]>
Used as a prefix to a subsequent macro. This macro should only be used on bill of lading template, under
05-Jan-24 DOCUMENTENGINE REFERENCE Page 33 of 39
circumstances that the size of cell on template cannot be adjusted. If the value inserted by the subsequent
macro does not fit in the cell in the template, the font size will be progressively reduced until it fits, to the
minimum of {MinimumFontSize}. If no minimum font size is specified, the text will be reduced to a minimum
of 8 point.
Note: <ShrinkToFitForBillOfLading> Will be ignored if <AutoHeight> is also specified in the same cell or
the cell Wrap Text property is not checked.
E.g: <ShrinkToFitForBillOfLading><ShipmentNumber>
E.g: <ShrinkToFitForBillOfLading(4.5)><ShipmentNumber>

<SignOff>
Returns the sign off text as well as the currently logged in user's title and published contact details. These
are defined in the Registry and Staff forms.
E.g: <SignOff>

<SignOffText>

ly
Returns the sign off text from the Registry.
E.g: <SignOffText>

on
<SSCCCheckDigit('{StringValue}')>
Is used to calculate the check digit from a barcode number.
E.g: <SSCCCheckDigit('34012345123458789')>

U t
al s
se
<Substitute("{Text}", "{OldValue}", "{NewValue}")>
ci Te
Replaces all occurrences of a specified value in the text, with another specified value.
E.g: <Substitute("<Z0_VarCharMax>", ":", "")>

<SubString("{text}", {start}[, {length}])>


er /
Returns a subset of characters from within the supplied string. Characters will be returned starting from the
zero based position specified by {start} and will continue to the end of the string if no {length} is specified. If a
m ng

{length} is specified, characters up to the length specified will be returned.


E.g: <SubString("<Z0_VarCharMax>", 0)>
E.g: <SubString("<Z0_VarCharMax>", 0, 8)>
i

<Subtract("{value1}","{value2}",...)>
om in

Will do the Subtraction of two or more values.


E.g: <Subtract("<TotalOSAmount>", "<OSOutstandingAmount>", "<OSOutstandingAmount>")>
C a

<SuppressField({ShouldSuppressField})>
Tr

Returns Boolean value indicating whether the field should be suppressed. List of possible parameters:
ETA
ETD
ATA
ATD
FlightNumber
TransportInfo
Carrier
on

DeclarationExportDate
DeclarationDateAtOrigin
DeclarationFolio
N

MasterBill
E.g: <SuppressField(MasterBill)>

<TaxCode>
Returns the local description for Consumption Tax based on the Country/Region Code set on the Current
Company's Registration (GlbCompany).
E.g: <TaxCode>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 34 of 39
<TextLineAt({fieldname},{lineno})>
Returns the specified line from the multi line value in the field specified.
E.g: <TextLineAt(Header.MultiLineText, 4)>

<Total {fieldname}>
Returns the total value of a given field in the group footer where that field name was shown in the body of a
section.
Inserts a +SUM(cell:cell) Excel formula in its place summing the field specified across the range of rows in
the body section in the final output.
E.g: <Total InvoiceLines.Amount>

<TotalPages>
Returns the total number or count of pages in the final output.
See also: CurrentPage.
E.g: <TotalPages>

ly
<TranslateDBField({DB Field Name},{English Text})>

on
Translate the English text stored in a particular DB field to the selected language in the report filter. You can
specify the Business Object name before the field name to load the Business Object if there are multiple
types referencing to the same database field.
E.g: <TranslateDBField(AG_Description, Description)>

U t
E.g: <TranslateDBField(StmMenuItem.SU_MenuName, English Text)>

al s
se
ci Te
<TranslateRegistry({RegistryID}, {English Text} [,{Language}])>
Translate the English text stored in a particular translatable registry to the selected language in the report
filter.
E.g: <TranslateRegistry(CashFlowActivityConfiguration, <EnglishText>, ZH-CN)>
er /
<TransportCoTrackingURL({CarrierCode},{CarrierReference})>
m ng

Presents a URL or Hyperlink in the resulting output to the carrier's cartage web site for a job.
E.g: <TransportCoTrackingURL(<CarrierCode>, <CarrierRef>)>

<Truncate("{text}", {length})>
i

Truncates a specified string so that the string cuts off after the length of characters specified by the user. An
om in

ellipsis '...' is used to replace the remaining characters after the specified length has been reached.
E.g: <Truncate("<JobDescription>", 20)>
C a

<UnselectedCollectionBatchTypesMacro>
Tr

Returns the List of Active Collection Batch read from the Registry.
E.g: <UnselectedCollectionBatchTypesMacro>

<UPC-A("{InputText}",{WidthInColumns},{HeightInRows})>
Returns a UPC-A code image that contains the text with the following supplied specifications:
- WidthInColumns: Number of columns to span in Excel;
- HeightInRows: Number of rows to span in Excel.
E.g: <UPC-A("<BarCodeText>", 2, 4)>
on

<Upper("{text}", {length})>
Returns the supplied string in UPPER CASE.
N

E.g: <Upper("<Z0_VarCharMax>")>

<UrlHyperlink({urllocation},{displaytext},{tooltiptext})>
Presents a properly formatted URL or Hyperlink in the resulting output that shows using the specified display
text and tool tip, and will navigate to the specified URL location if the user clicks on the link.
E.g: <UrlHyperlink(http://www.cargowise.com,CargoWise WebSite,Click to navigate to the CargoWise
Website)>
05-Jan-24 DOCUMENTENGINE REFERENCE Page 35 of 39
<USCustomsDisbursementChargeCodes>
Will return a concatenated GUIDs separated by '|' that are set in Registry in 'Default Customs Disbursement
Charge Code' and 'US Customs Disbursement Charge Code Override'.
E.g: <USCustomsDisbursementChargeCodes>

<UserRepository>
Returns the user repository database name.
E.g: <UserRepository>

<UTCTimeOffset>
Returns the time difference in minutes between current time zone's standard time and UTC.
E.g: <UTCTimeOffset>

<WhsInventoryDutyAndTax('{typeOfDataToReturn}', '{countryCode}', '{inventoryPK}', '{tariff}',


'{countryOfOrigin}', '{customsValue}', '{customsQty1}', '{customsUQ1}', '{customsQty2}',

ly
'{customsUQ2}', '{customsQty3}', '{customsUQ3}', '{ratio}', '{arrivalDate}')>
Returns the Customs Duty or Tax data for a particular Warehouse Inventory record.

on
Please ensure that the arrivalDate is ShortDateFormat.
E.g: <WhsInventoryDutyAndTax('DTY', '<Inventory.WarehouseCountry>', '<Inventory.PK>',
'<Inventory.Tariff>', '<Inventory.CountryOfOrigin>', '<Inventory.CustomsValue>',
'<Inventory.CustomsQty1>', '<Inventory.CustomsUQ1>', '<Inventory.CustomsQty2>',

U t
'<Inventory.CustomsUQ2>', '<Inventory.CustomsQty3>', '<Inventory.CustomsUQ3>',

al s
se
'<Inventory.Ratio>', '<DateTimeAsString('<Inventory.ArrivalDate>', 'ShortDateFormat')>')>
ci Te
E.g: <WhsInventoryDutyAndTax('VAT', '<Inventory.WarehouseCountry>', '<Inventory.PK>',
'<Inventory.Tariff>', '<Inventory.CountryOfOrigin>', '<Inventory.CustomsValue>',
'<Inventory.CustomsQty1>', '<Inventory.CustomsUQ1>', '<Inventory.CustomsQty2>',
'<Inventory.CustomsUQ2>', '<Inventory.CustomsQty3>', '<Inventory.CustomsUQ3>',
er /
'<Inventory.Ratio>', '<DateTimeAsString('<Inventory.ArrivalDate>', 'ShortDateFormat')>')>
m ngi
om in
C a
on Tr
N
05-Jan-24 DOCUMENTENGINE REFERENCE Page 36 of 39

Syntax and Formatting Commands (useable on Documents only)


Using Format() on a DataSource
Useage: [datasource.]Format(formatstring)

Let's say we have a related DocumentWrapper called "Person" with the 3 fields "Name", Suburb", and
"Region" where:

Person.Name = "Fred"
Person.Suburb = "Homebush"
Person.Region = "North"

If we inserted the following syntax in a cell:

<Person.Format("{Name} from {Suburb} – Region: {Region}")>

ly
The resulting text shown when the document was rendered would be:

on
Fred from Homebush – Region: North

Any block of text wrapped in curly braces ( "{" and "}" ) within a Format String is replaced with the contents of

U t
the field specified by the block of text within the curly braces as long as a valid field name is specified.

al s
se
The curly braces are also removed, and any text not enclosed within curly braces is simply included as part
ci Te
of the result so you can specify your own spacing, delimiters or separators as required.

Format Codes in Format Strings


When inserting fields in a formatstring, you can optionally specify a formatcode for each fieldname wrapped
er /
in curly braces within the formatstring. You can use a formatcode to determine how fields are presented
m ng

within the document.

Instead of just inserting {fieldname} you can use {fieldname:formatcode} which will present the same data,
but in the format designated by whatever format code you specify.
i
om in

String Field Format Codes


{StringField:Upper} – Contents of the field converted to UPPER case.
{StringField:Lower} – Contents of the field converted to lower case.
C a

{StringField:Proper} – Contents of the field converted to Proper case.


Tr

Date Field Format Codes


{DateField:Date} – Standard Date Format – eg: 23-Jan-06
{DateField:LongDate} – Long Date Format – eg: Monday, January 23rd, 2006
{DateField:AmericanDate} – American Date Format – eg: 01/23/06
{DateField:AmericanDateWithCentury} – American Date Format – eg: 01/23/2006
{DateField:BritishDate} – British Date Format – eg: 23/01/06
{DateField:Day} – Day of the Week – eg: Monday
on

{DateField:Time24h} – 24 hour Format Time – eg: 18:34


{DateField:Time12h} – 12 hour Format Time – eg: 6:34p
{DateField:SpanishDate} – Spanish Date Format – eg: 23-01-2006
N

Boolean Field Format Codes


{BooleanField:X} - Returns either X for true or a blank string. Used for making CheckBoxes work.
{BooleanField:YN} - Returns either Y or N.
{BooleanField:YesNo} - Returns either Yes or No.
{BooleanField:TrueFalse} - Returns either True or False.

Numeric Field Format Codes


Numeric Formatters consist of a Single Letter followed by an optional 1 or 2 digit number known as the
05-Jan-24 DOCUMENTENGINE REFERENCE Page 37 of 39
Precision Indicator. The letter indicates the basic format used to format the number, and the Precision
Indicator gives addition information on how the number should be formatted.

Numeric Format Letters:

C - Currency - Converted to a string that represents a currency amount. The conversion is controlled by the
currency format information of the NumberFormatInfo object used to format the number. The precision
specifier indicates the desired number of decimal places. If the precision specifier is omitted, the default
currency precision given by the NumberFormatInfo is used.
eg: {NumericField:C2} - $1.99

D – Decimal - Converted to a string of decimal digits (0-9), prefixed by a minus sign if the number is
negative. The precision specifier indicates the minimum number of digits desired in the resulting string. If
required, the number is padded with zeros to its left to produce the number of digits given by the precision
specifier.

ly
eg: {NumericField:D10} - 0000001.99

on
E - Scientific (exponential) - Converted to a string of the form "-d.ddd…E+ddd", where each 'd' indicates a
digit (0-9). The string starts with a minus sign if the number is negative. One digit always precedes the
decimal point. The precision specifier indicates the desired number of digits after the decimal point. If the
precision specifier is omitted, a default of six digits after the decimal point is used. The exponent always

U t
consists of a plus or minus sign and a minimum of three digits. The exponent is padded with zeros to meet

al s
se
this minimum, if required.
ci Te
eg: {NumericField:E6} - 1.990000E+0

F - Fixed-point - Converted to a string of the form "-ddd.ddd…" where each 'd' indicates a digit (0-9). The
string starts with a minus sign if the number is negative. The precision specifier indicates the desired number
er /
of decimal places. If the precision specifier is omitted, the default numeric precision given by the
NumberFormatInfo is used.
m ng

eg: {NumericField:F3} - 1.990

N – Number - Converted to a string of the form "-d,ddd,ddd.ddd…", where each 'd' indicates a digit (0-9). The
string starts with a minus sign if the number is negative. Thousand separators are inserted between each
i

group of three digits to the left of the decimal point. The precision specifier indicates the desired number of
om in

decimal places. If the precision specifier is omitted, the default numeric precision given by the
NumberFormatInfo is used.
C a

eg: {NumericField:N4} - 4,343,122.0040


Tr

P – Percentage - Converted to a string of the form "-d,ddd.ddd…", where each 'd' indicates a digit (0-9).
Value provided is multiplied by 100 to make a percentage, and starts with a minus sign if the number is
negative. A percentage symbol is added as a suffix to the expression returned with a space between the %
and the last digit. Thousand separators are inserted between each group of three digits to the left of the
decimal point. The precision specifier indicates the desired number of decimal places. If the precision
specifier is omitted, the default numeric precision given by the NumberFormatInfo is used.
eg: {NumericField:P1} - 434,312,200.4 %
on

T – Trim Trailing Zeros - Converted to a string of the form "-dddd.ddd…", where each 'd' indicates a digit
(0-9). The string starts with a minus sign if the number is negative. The precision specifier indicates the
maximum desired number of decimal places. All trailing zeros are removed after the value has been rounded
N

to the specified number of decimal places. If the precision specifier is omitted, the default numeric precision
given by the NumberFormatInfo is used but all trailing zeros are removed.
eg: {NumericField:T4} - 4343122.004

DataSourceCollection.Format()
Useage: datasourcecollection.Format(formatstring [, delimiter [, filter [, groupbystring [, maxItems]]]] )

You can also use the Format() function on any DataSource Collection. Format() will evaluate the formatstring
on each DataSource in the specified Collection and return a concatenation of the evaluated expressions
05-Jan-24 DOCUMENTENGINE REFERENCE Page 38 of 39
delimited by the specified delimiter. If you don't specify a delimiter, Comma will be used as the default.

You can optionally specify one of the following delimiters used to separate the data from each DataSource in
the Collection:
Comma
Space
NewLine
Dash
Colon
If you don't specify a delimiter, Comma will be used by default.

Let's say you had a Collection of Container DataSources called Containers. There are 2 containers in the
Collection with a ContainerNumber and Mode.

<Containers.Format("{ContainerNumber} ({Mode})", Comma)>

ly
would be replaced with:
OOCL0000006 (FCL), OOCL0000011 (LCL)

on
<Containers.Format("{ContainerNumber} ({Mode})", NewLine)>
would be replaced with:
OOCL0000006 (FCL)<cr><lf>

U t
OOCL0000011 (LCL)

al s
se
ci Te
NB: Please note that for the 'NewLine' delimiter to work across multiple lines, you need to either format the
cell to have 'Wrap text' turned on (right click on the cell, select 'Format Cells', go to 'Alignment' tab), or use
the <AutoHeight> macro like so:-
er /
<AutoHeight><Containers.Format("{ContainerNumber} ({Mode})", NewLine)>
m ng

You can use a filter as the 3rd argument. The filter applies to properties on items from the datasource
collection.
If you don't specify a filter, the empty filter "" will be used by default.
i

Let's say you had a Collection of Container DataSources called Containers. There are 3 containers in the
om in

Collection with a ContainerNumber and Mode.


C a

<Containers.Format("{ContainerNumber} ({Mode})", Comma, "")>


would be replaced with:
Tr

OOCL0000006 (FCL), OOCL0000011 (LCL), OOCL0000015 (FCL)

<Containers.Format("{ContainerNumber} ({Mode})", Comma, "{Mode}" == "FCL")>


would be replaced with:
OOCL0000006 (FCL), OOCL0000015 (FCL)

You can also use a group-by string as the 4th argument. When specified, the elements will be grouped by
the values specified in the group by string and the format string will be evaluated only once for each group.
on

Also, the format string will evaluate {Count} as the number of elements in the group.

Let's say you had a Collection of Container DataSources called Containers. There are 5 containers in the
N

Collection, 3 are 20GP containers and 2 are 40GP containers.

<Containers.Format("{Count} x {Type})", Comma, "", "{Type}")>


would be replaced with:
3 x 20GP - Twenty Foot General Purpose, 2 x 40GP - Fourty Foot General Purpose

You can specify the maximum number of items to be formatted.


If you also specify a Group-by string, the maximun will be applied to the grouped strings.
05-Jan-24 DOCUMENTENGINE REFERENCE Page 39 of 39

Let's say you had a Collection of Container DataSources called Containers. There are 3 containers in the
Collection with a ContainerNumber.

<Containers.Format("{ContainerNumber}", Comma, "", "", 3)>


would be replaced with:
OOCL0000006, OOCL0000011, OOCL0000015

<Containers.Format("{ContainerNumber}", Comma, "", "", 2)>


would be replaced with:
OOCL0000006, OOCL0000011

If the maximun number is less than 1, the parameter will be ignored.

DataSourceCollection.Total()

ly
Useage: datasourcecollection.Total(fieldname [, decimalplaces, [filter]])

on
You can use the Total() function on any DataSource Collection. Total() will provide a string representation of
the total value of the field specified from each DataSource in the Collection.

If you don't specify a number of decimal places, zero is assumed, and if the result is zero, a blank string is

U t
returned.

al s
se
ci Te
The filter parameter is a conditional statement calculated for each item in the collection (eg. "{GS_IsActive}"
== "Y" (is staff member active)). If the condition is false, the item is not included in the calculation of the
Total.
er /
DataSource.DocDataValue()
Useage: [datasource.]DocDataValue(docdatafieldname [, fallbackformatstring])
m ngi
om in
C a
on Tr
N
05-Jan-24 TEMPLATE SPECIAL SHEETS SUMMARY Page 1 of 1

Sheet Name: Fields


User defined fields are included on the User Defined Data tab by adding items to this sheet. This sheet is
available in document templates only.

Sheet Name: #FlexCelScale


The document width/height can be scaled by setting scale values in this sheet. This sheet is available in both
report and document templates.

ly
on
U t
al s
se
ci Te
er /
m ngi
om in
C a
on Tr
N
05-Jan-24 FIELD SHEET REFERENCE Page 1 of 19

Sheet Name: Fields


User defined fields are included on the User Defined Data tab by adding items to this sheet. This sheet is
available in document templates only.

Sheet Format
Syntax:
{Display Name}
{Supported Properties} {Property Value}

#end

Explanations:

ly
{Display Name}
Displayed as a label left to the field as the description on form.

on
{Supported Properties}
The property.
{Property Value}

U t
The value of each property.

al s
se
Example:
ci Te
er /
m ngi
om in
C a
on Tr
N
05-Jan-24 FIELD SHEET REFERENCE Page 2 of 19

All Field Types Used on Documents


Checkbox
Generates a check box control from the provided options allowing multiple selections. Set the value of this
field with the selected values.

Value Provider Format:


<DisplayName>: Returns the value of the current filter.
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
<DisplayName.CommaSeperatedValues>: Returns the selected Descriptions as comma separated list.
Supported Properties:
type
tab

ly
default
left

on
top
width
height
dataContext

U t
field

al s
se
tab
required
onlyoneofgroup
anyoneofgroup
ci Te
atleastoneofgroup
readonlyif
er /
type
m ng

onlycurrentperiodifpaybywebservice
onlycurrentcompanyifsetincommissionregistry
dependentfilter
dependentfilterreadonlyifvalue
i

disableReadOnlyIfDependency
om in

options
radiobutton
datalist
C a

defaultvalue
Tr

Date
Generates a date control. Set the field value with the date.

Value Provider Format:


<DisplayName>: Returns the value of the current filter.
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
on

<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
<DisplayName.SqlFormat>: Returns the SQL formatted value of the selected date.
<DisplayName.EndOfDate>: Returns the selected date with the time component set to 23:59:59.
<DisplayName.ToNextDate>: Returns the selected date plus one day.
N

<DisplayName.ValueForSQLParameter>: Returns the selected date for use as an SQL parameter.


Supported Properties:
type
tab
default
left
top
width
height
05-Jan-24 FIELD SHEET REFERENCE Page 3 of 19
dataContext
field
tab
required
onlyoneofgroup
anyoneofgroup
atleastoneofgroup
readonlyif
type
onlycurrentperiodifpaybywebservice
onlycurrentcompanyifsetincommissionregistry
dependentfilter
dependentfilterreadonlyifvalue
disableReadOnlyIfDependency
date format

ly
defaultvalue

on
Lookup
Generates a lookup filter whose value will be a GUID, with available selections from the lookup list. Set the
field value with the data matching that GUID.

U t
al s
se
Value Provider Format:
ci Te
<DisplayName>: Returns the value of the current filter.
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
<DisplayName.Code>: Returns the code of the selected value.
<DisplayName.Description>: Returns the description of the selected value.
er /
Supported Properties:
m ng

type
tab
default
i

left
om in

top
width
height
C a

dataContext
Tr

field
tab
required
onlyoneofgroup
anyoneofgroup
atleastoneofgroup
readonlyif
type
on

onlycurrentperiodifpaybywebservice
onlycurrentcompanyifsetincommissionregistry
dependentfilter
dependentfilterreadonlyifvalue
N

disableReadOnlyIfDependency
relates
defaultvalue
*Support built-in select collection

Memo
Generates a multi-line text box control for a text field.
05-Jan-24 FIELD SHEET REFERENCE Page 4 of 19
Value Provider Format:
<DisplayName>: Returns the value of the current filter.
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
Supported Properties:
type
tab
default
left
top
width
height
dataContext

ly
MultipleChoice
Generates a check box filter with a lookup list allowing multiple selections. Set the field value with the

on
selected values.

Value Provider Format:

U t
<DisplayName>: Returns the value of the current filter.

al s
se
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
ci Te
<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
<DisplayName.Description>: Return the description of the selected value.
Supported Properties:
type
er /
tab
default
m ng

left
top
width
i

height
om in

dataContext
field
tab
C a

required
onlyoneofgroup
Tr

anyoneofgroup
atleastoneofgroup
readonlyif
type
onlycurrentperiodifpaybywebservice
onlycurrentcompanyifsetincommissionregistry
dependentfilter
on

dependentfilterreadonlyifvalue
disableReadOnlyIfDependency
default
defaultvalue
N

style
option
allowInvalidCode

Number
Generates a number control whose value is a decimal. Set the field value with the number.

Value Provider Format:


05-Jan-24 FIELD SHEET REFERENCE Page 5 of 19
<DisplayName>: Returns the value of the current filter.
<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.
<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
Supported Properties:
type
tab
default
left
top
width
height
dataContext
field
tab

ly
required
onlyoneofgroup
anyoneofgroup

on
atleastoneofgroup
readonlyif
type

U t
onlycurrentperiodifpaybywebservice

al s
se
onlycurrentcompanyifsetincommissionregistry
dependentfilter
dependentfilterreadonlyifvalue
disableReadOnlyIfDependency
ci Te
defaultvalue
decimal places
er /
show group separators
min value
m ng

max value

Text
i
om in

Generates a single-line text box control for a text field.

Value Provider Format:


C a

<DisplayName>: Returns the value of the current filter.


Tr

<DisplayName.UserFriendlyValue>: Return the user friendly value of the current filter.


<DisplayName.IsEmpty>: Returns a boolean set to true if the current filter has no data, false otherwise.
Supported Properties:
type
tab
default
left
top
on

width
height
dataContext
N
05-Jan-24 FIELD SHEET REFERENCE Page 6 of 19

Document User defined Field Property Instruction


dataContext
Value representing the data context used by this field.
default
The default value for this field.
For the Number field, this default value can be <now.year> and will return the value of the current year.
height
The height of the field control in pixels.
left
Value that representing the distance, in pixels, between the left edge of the field control and the left edge of
its container's client area.

ly
tab
Determines which tab this field belongs to. Value is treated as tab name, can be any characters.

on
top
Value representing the distance, in pixels, between the bottom edge of the field control and the top edge of
its container's client area.

U t
type

al s
se
'Type' determines the field to be shown in GUI.
width
ci Te
The width of the field control in pixels.
er /
m ngi
om in
C a
on Tr
N
05-Jan-24 FIELD SHEET REFERENCE Page 7 of 19

CargoWise One supported built-in Lookups


accreditation
Get all accreditations
address
Get all organization addresses.
bank account
Get all active bank accounts under current company.
branch
Get all active branches under current company.
ca_carrier
Get all Canada's combined carriers, available in Canada logged in user only.

ly
ca_cbsaoffice
Get all CBSA office codes, available in Canada logged in user only.

on
ca_country
Get all Canada's countries/regions, available in Canada logged in user only.

U t
campaign

al s
se
Get all company campaigns.
ca_placeofreport ci Te
Get all Canada's places of report, available in Canada logged in user only.
ca_portofexit
Get all exit ports
er /
carrier
m ng

Get all active organization which is both shipping provider and local transport.
ca_sublocation
Get all Canada's sub locations, available in Canada logged in user only.
i
om in

certificate exam
Get all learning center company campaigns.
C a

charge code
Tr

Get all active charge codes under current company.


cheque book
Get all active cheque books under current company.
chs local account
Get all active Chinese local general ledger account.
commission agreement
on

Get all organization commission agreements.


commodity code
Get all active commodity codes.
N

communication
Get all communications.
company
Get all active companies.
contact
Get all active organization contacts.
container code
05-Jan-24 FIELD SHEET REFERENCE Page 8 of 19
Get all active container codes.
country
Get all active countries/regions
creditor
Get all creditors under current company.
creditor group
Get all organization creditor groups.
currency
Get all active currencies groups.
daily statement
Get US daily statement numbers.

ly
debtor
Get all debtors under current company.

on
debtor group
Get all active organization debtor groups.
declaration

U t
al s
se
Get all not canceled job declarations under current company.
department ci Te
Get all active departments.
dependence
Available in dependence lookup, return the other lookups.
er /
deposit batch
m ng

Get all receipt batch and cashbook account transaction headers under current company
exporter
Get all active consignors.
i
om in

fdaproductnumber
Get all US PGA FDA product number.
C a

forwarder
Get all active organizations which are forwarders.
Tr

ftz warehouse
Get all active FTZ warehouses that you can access.
gl account
Get all active account general ledger.
global credit group
Get all Global Credit Group
on

groups
Get all active groups.
N

hold code
Get all hold codes.
importer
Get all active consignees.
inquiry manager
Get all inquiries.
job applicant
Get all job applicants.
05-Jan-24 FIELD SHEET REFERENCE Page 9 of 19

job skill
Get all job skills.
kr_customsoffice
Get Korean customs office list.
local account
Get all active local general ledger account.
location
Get all active UN/LOCODE or countries/regions or all/reporting zones.
locationtype
Get all warehouse location types.
meeting resource

ly
Get all active resource type staffs.
monthly statement

on
Get US monthly statement numbers.
ncts departure offices

U t
Get NCTS departure customs offices.

al s
se
ncts destination offices
ci Te
Get NCTS destination customs offices.
netting period
Get all netting system periods under current company.
one off quotes
er /
Get all One Off Quotes.
m ng

opportunity manager
Get all opportunities.
organisation
i
om in

Get all active organizations.


overseas agent
C a

Get all active organizations.


Tr

person
Get all persons
product category
Get all organization part categories.
project
Get all work projects from EDI customer.
on

quotations
Get all quotations.
quoted booking
N

Get all quoted bookings.


receiving agent
Get all active organizations which are forwarders.
sales/expense groups
Get all account groups.
salesteam
Get all active sales groups.
05-Jan-24 FIELD SHEET REFERENCE Page 10 of 19
sea voyage
Get all active see job voyages.
sending agent
Get all active organizations which are forwarders.
sequence book
Get all Sequence Books.
service level
Get all active service levels.
settlement group
Get all active organizations.
shipment

ly
Get all not canceled and have forward registered job shipments.
shipping provider

on
Get all active organizations which are shipping providers.
ships agency principal
Get all active organizations which are ships agency principal

U t
al s
se
staff
Get all active non-resource type staffs.
staff and resource
Get all active staffs.
ci Te
supplier
er /
Get all active consignors.
m ng

supplierpart
Get all active supplier parts.
tax id
i

Get all active account tax rate under current logged in country/region.
om in

tax msg
Get all active account invoice tax messages under current country/region.
C a

trade lane
Tr

Get all trade lines.


transaction branch
Get all active branches under current company.
transaction department
Get all active departments.
transit warehouse
on

Get all active transit warehouses that you can access.


transport booking
N

Get all active transport bookings.


transport client
Get all active organizations which are transport clients.
tw goods location
Get all Taiwan's goods locations.
unloco
Get all active UN/LOCODE.
05-Jan-24 FIELD SHEET REFERENCE Page 11 of 19
us_carrier
Get all United States' combined carriers, available in United-States logged in user only
us_country
Get all United-States' countries/regions, available in United-States logged in user only.
us_domesticport
Get all United-States' schedule D-Port codes, available in United-States logged in user only.
us customs entries
US Customs Entries
us_foreignport
Get all United-States' schedule K-Port codes, available in United-States logged in user only.
vehicle

ly
Get all active vehicles.
vessel

on
Get all active vessels.
viewlocation
Get all view locations, include UN/LOCODE, Country/Region, State, City, International Zone, Transport

U t
Zone.

al s
se
vote campaign
Get all vote company campaigns.
warehouse
ci Te
Get all active non-transit warehouses that you can access.
er /
warehouse client
m ng

Get all active organizations which are warehouse client that you can access.
warehouse product
Get all active warehouse products.
i

whsarea
om in

Get all warehouse areas.


whspickingarea
C a

Get all warehouse pick areas.


Tr

whsputawayarea
Get all warehouse putaway areas.
workitem
Get all work items in process management.
zone
Get all active international zones.
on
N
05-Jan-24 FIELD SHEET REFERENCE Page 12 of 19

CargoWise One supported Report Filter {code list type} Lookups


This section lists all the sources that we support for filter {code list type}
abccategory
Get all ABC category list.
additionalreferencenumbertype
Get all additional reference number list.
airdensity
Get all air density list.
apagreedpaymentmethods
Get all payables credit agreed payment methods.
apcategory

ly
Get all payables category list.
aptaxconfigurations

on
Get all AP tax configurations applicable for current company.
aragreedpaymentmethods
Get all receivables credit agreed payment methods.

U t
arcategory

al s
se
Get all receivables category list.
arcreditratinglist
ci Te
Get all receivables credit rating list.
areatype
er /
Get all warehouse area type list.
m ng

artaxconfigurationorgrates
Get all AR tax configurations applicable for current company with Tax System Rate Source ORG, OFI or
OFT.
i

artaxconfigurations
om in

Get all AR tax configurations applicable for current company.


asycudadeclarationtypes
C a

Get all Asycuda Declaration Types.


Tr

branchmanagementcode
Get all branch management list.
caacrossserviceoptions
Get all CA ACROSS service options list.
caremissiontypes
Get all CA Remission type list.
on

cartagedropmode
Get all cartage drop mode list.
cashflowcategory
N

Get all cash flow category list.


castateoforigin
Get State of Origin list.
catarifftreatmentcodes
Get all CA Tariff Treatment code list.
category
Get all category list.
05-Jan-24 FIELD SHEET REFERENCE Page 13 of 19
certaintylikertitem
Get all certainty Likert item list.
certificatetype
Get all certificate type list.
chargegroup
Get all charge codes.
claimreason
Get all claim reasons.
claimstatus
Get all claim status.
claimtype

ly
Get all claim types.
clientsize

on
Get all client size list.
closeopportunityreason
Get all close opportunity reason list.

U t
al s
se
closereason
Get all enquiry close reason list.
commissionstreams
Get all commission agreement streams.
ci Te
commissiontypes
er /
Get all sales commission types.
m ng

communicationstatus
Get all communication status list.
compliancesubtype
i

Get all sequence class list base on current company country code in local language.
om in

consolacccategory
Get all consolidated accounting category list.
C a

consoltype
Tr

Get all consol types list.


contactgroup
Get all contact types.
containercleancodes
Get all container clean codes.
containercodes
on

Get all container codes.


containerdamagecodes
N

Get all container damage codes.


containerquality
Get all container quality list.
declarationentrystatus
Get all declaration entry status.
declarationentrytype
Get all declaration entry types.
05-Jan-24 FIELD SHEET REFERENCE Page 14 of 19
declarationmessagestatus
Get all declaration message status.
declarationmessagesubtype
Get all declaration message sub types.
declarationmessagetype
Get all declaration message types.
declarationpackmode
Get all declaration pack modes.
declarationpaymentmethod
Get all declaration payment methods.
declarationservicelevel

ly
Get all declaration service levels.
declarationtransportmode

on
Get all declaration transport modes.
demonthlyclosingdeclarationtype
Get all Monthly Closing Declaration Types

U t
al s
se
documenttype
Get all document types.
enquiryleadinterest
Get all enquiry lead interest list.
ci Te
enquirytype
er /
Get all enquiry type list.
m ng

enquirytypeactive
Get all enquiry type active list.
eudeclarationentrysubstyle
i

Get all EU declaration entry sub style.


om in

exceptionevents
Get all exceptions of events.
C a

frcustomsoffices
Tr

Get all FR customs offices list.


frcustomsprofiles
Get all FR customs profile.
freightcontainermode
Get all freight container mode list.
freightrateclass
on

Get all freight rate class list.


fristcustomsprofiles
N

Get IST customs profiles based on Presenter


fristlocationofgoods
Get IST location of goods based on Presenter Address
frprocedurecodes
Get all FR procedure codes list.
gllanguage
Get all GL languages.
05-Jan-24 FIELD SHEET REFERENCE Page 15 of 19
glrolluplevel
Get all GL roll up levels.
goodsreceivedstatus
Get all purchase order goods received notes list.
groupcategories
Get the Group Categories defined in the registry.
housebilltype
Get all house bill type list.
inbondmessagestatus
Get all inbond message status list.
incoterms

ly
Get all domestic payment terms.
industryverticaltype

on
Get all industry vertical type list.
isfactionreasoncode
Get all US ISF action reason code list.

U t
al s
se
isfbilltype
Get all US ISF bill type list.
isfbondactivitycode
ci Te
Get all US ISF bond activity code list.
isfdispositioncode
er /
Get all US ISF disposition code list.
m ng

isfentrytype
Get all US ISF entry type list.
isfmessagestatus
i

Get all US ISF message status list.


om in

isfshipmenttype
Get all US ISF shipment type list.
C a

isftransportmode
Tr

Get all US ISF transport mode list.


iswrittenoffd48
Get the D48 choices for the Written off parameters.
itcustomsoffices
Get all IT customs offices list.
itentryinstructionstylelist
on

Get all IT entry instruction styles.


itmethodsofpayment
N

Get all IT methods of payment


jobheaderstatus
Get all job header status list.
jobprofitlossreason
Get all job profit loss reason list.
kr_exporttype
Get all Korea's export types.
05-Jan-24 FIELD SHEET REFERENCE Page 16 of 19
kr_paymentmethod
Get all Korea's payment method types.
kr_proceduretype
Get all Korea's procedure types.
kr_transactiontype
Get all Korea's transaction types.
kr_transportmode
Get all Korea's transport modes.
language
Get all language list.
licensetypes

ly
Get all staff license types.
localtransportjobtype

on
Get all local transport job type list.
locationstatus
Get all warehouse location status list.

U t
al s
se
milestoneeventtypeslist
Get all milestone event types.
monthlist
Get all Month lists.
ci Te
nctsdeclarationtypes
er /
Get all NCTS declaration types.
m ng

nctsguarantees
Get all NCTS guarantees.
nzentrypaymentstatus
i

Get all NZ entry payment status.


om in

onestopcarrier
Get all one stop carriers.
C a

opportunityoutcome
Tr

Get all opportunity outcome list.


opportunityproducttype
Get all opportunity product type list.
opportunitysource
Get all opportunity source list.
opportunitystage
on

Get all opportunity stage list.


opportunitystatus
N

Get all opportunity status list.


opportunitytype
Get all opportunity type list.
orderheaderstatus
Get all order header status.
ordermilestoneeventlist
Get order milestone event types.
05-Jan-24 FIELD SHEET REFERENCE Page 17 of 19
organisationnotetypes
Get all organization note types.
organisationtype
Get all organization type list.
orgfreightdirection
Get all organization direction list.
orgrelatedpartytype
Get all organization party types.
orgtransportmode
Get all organization transport modes.
parentjobtype

ly
Get all parent job type list.
paymentmethod

on
Get all payment method list.
periodofactivitytype
Get all period of activity type list.

U t
al s
se
pickupmethod
Get all warehouse pick method list.
presentationcategory
Get all GL presentation category list.
ci Te
presentationcategorygroup
er /
Get all GL presentation category group list.
m ng

previousprocedurecodes
Get all previous procedure codes.
procedurecodes
i

Get all procedure codes.


om in

quotecancellationreason
Get all quote cancellation reason list.
C a

reporttypes
Tr

Get all report types of GL Account.


salescalltype
Get all communication type list.
salescategory
Get all sales category code list.
salesleadtype
on

Get all sales lead type list.


salesrelationtype
N

Get all sales relation type list.


salesterritory
Get all sales territory list.
shipmenttransportmode
Get all shipment transport mode list.
staffholidaysstatus
Get all staff holidays status.
05-Jan-24 FIELD SHEET REFERENCE Page 18 of 19
staffholidaystype
Get all staff holidays types.
staffmemberassignmentroles
Get all staff assignment roles list.
storageclass
Get all container storage class.
subaccounttype
Get all sub account type list.
taxconfigurations
Get all (both AR and AP) tax configurations applicable for current company.
translatelanguage

ly
Get all translate language list.
twdeclarationtypelist

on
Get all TW Declaration type list
twofficeofreceiptlist
Get all TW Office of receipt list

U t
al s
se
usaccrecondicrepancytype
Get all US statement line filters.
usaphisprocessingcode
Get all US APHIS processing codes.
ci Te
usaphisprogramtype
er /
Get all US APHIS program types.
m ng

usdotagencyprogramcodes
Get all US DOT agency program codes.
usdotboxnumbers
i

Get all US DOT box numbers.


om in

useistatuslist
Get all US EI status list.
C a

usensstatuslist
Tr

Get all US ENS status list.


usentrymodelist
Get all US entry mode list.
usfdaagencyprogramcode
Get all US FDA agency program codes.
usfdaprocessingcodes
on

Get all US FDA processing codes.


usfdastatuslist
N

Get all US FDA status list.


usftzadmissionmessagestatuslist
Get US FTZ Admission message status list.
usftzadmissiontype
Get all US FTZ admission type list.
usftzconcurrencemessagestatuslist
Get US FTZ Concurrence message status list.
05-Jan-24 FIELD SHEET REFERENCE Page 19 of 19
usftzdeliveryofgoodsmessagestatuslist
Get US FTZ Delivery of Goods message status list.
usftzgoodsarrivalmessagestatuslist
Get US FTZ Goods Arrival message status list.
usftzpttmessagestatuslist
Get US FTZ PTT message status list.
usimporterbondtype
Get all US importer bond types.
usliquidationtype
Get all US liquidation types.
usmessagemode

ly
Get all US job application list.
uspaymentstatuslist

on
Get all US payment status list.
uspaymenttype
Get all US broker payment types.

U t
al s
se
usproductclaimcodelist
Get all US Product claim code list.
usreconissuelist
Get all US RECON issue list.
ci Te
usreleasestatus
er /
Get all US release status.
m ng

usspilist
Get all US SPI code list.
ustaxdeferredindlist
i

Get all US tax deferred list.


om in

whsadjustmentreason
Get all warehouse adjustment reason list.
C a

whsdockettypeandsubtype
Tr

Get all warehouse job types with subtype list.


workflowtypelist
Get all workflow types.
yesnolist
Get all YESNO list.
zacustomsoffices
on

Get all ZA customs offices list.


zafrncustomsoffices
N

Get all ZA FRN customs offices list.


zaprovisionalpaymenttypes
Get all ZA provisional payment types.
zareleaseprintindicators
Get all ZA release print indicators list.
zashipmenttype
Get all ZA manifest shipment type list.
05-Jan-24 FLEXCEL SCALE SHEET REFERENCE Page 1 of 1

Sheet Name: #FlexCelScale


The document width/height can be scaled by setting scale values in this sheet. This sheet is available in both
report and document templates.

Sheet Format
Syntax:
{X Scale}
{Y Scale}

Explanations:
{X Scale}
The value of the width scale factor. Should be put in cell B1 and the value should be bigger than 0.5.
For example, if the value of this field is set to 0.8, the width of the document would be scaled to 0.8

ly
times the original size.
{Y Scale}

on
The value of the height scale factor. Should be put in cell B2 and the value should be bigger than 0.5.
For example, if the value of this field is set to 0.8, the height of the document would be scaled to 0.8
times the original size.

U t
Example:

al s
se
ci Te
er /
m ngi
om in
C a
on Tr
N

You might also like