Printed forms

Index

Back: Functionality

Printed forms - Word

  • The docxtemplater library is used
  • See the examples of the connecting and using docxtemplater library.

Format transfer options

The table_col parameter is to transfer the formatting. See the rulles and examples here.

format:

${table_col:коллекция:разделитель:формат}

example:

${table_col:list.instructions.limit:;:DD.MM.YYYY}

result:

30.08.2017;06.09.2017

The format allows the use of the : symbol.

Displays the value of the sum in the upper case

There is a toWordsfilter for docx templates, which converts to text by default. If you add “true” as the second parameter , then a ruble format will be added (rubles - kopecks).

Example:

{costing.costExp | toWords:true}

As a result, the value of the “costExp” attribute equals 345.52. The result in written form is = Three hundred and forty five rubles fifty two kopecks.

Conversion between date and string

The following functions are available:

  • date - convert string to date
  • upper - string to upper case
  • lower - string to lower case

In the export to docx, the following filters are available in expressions:

  • lower - to lower case
  • upper - to upper case
  • dateFormat - convert date to string, examples of use:
    • {now | dateFormat:en}
    • {since | dateFormat:en}
    • {date | dateFormat:en:YYYYMMDD}
  • toDate - string to date

Current date value - _now

{_now} г.

Setting to display field values from an array of objects

If you need to display fields from an array of objects (collection for example), use the tag:

${table_col:list.collection.attrFromCollection}

By default, the values will be connected by a semicolon. To indicate another separator, specify it after the second colon:

${table_col:list.collection.attrFromCollection:разделитель}

License                                        Contact us                                         English

iondv metrics

Copyright (c) 2018 LLC “ION DV”.
All rights reserved.