What is Document Generator

"Document Generator" allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data.

This can be triggered in actions used in Action Links or Rich Forms buttons.

The generated document can either be downloaded directly in the browser or be stored in a SharePoint library.

Main advantages:

Word Document is generated on a fully customizable template

Creating a template is as simple as writing a word document and can be done by power users

Metadata of a single item, a list or even connected sublists with all their data can be added into this document

Report across a dossier (master-slave relation) can be created

The Document Generator feature provides the ability to generate different types of documents, such as:

Invoice

Factsheet

Project Report

Correspondence

Work Report

Order Confirmation

Inventory List

... and many more

Configuration UI

A new action type is introduced in the Action Builder of Action Links and Rich Forms.

Configuration for a single item (example: Action Link on a Display Form):

Configuration for multiple items (example: Action Link on a View):

Description of the configuration parameters:

Template

Provided Word Template that contains placeholders can be uploaded here (templates are stored in a hidden library "sbDocumentGenerator")The current used template can be downloaded by clicking on the “Current template” link.

Data

Choice: “For single item” / “For multiple items”

List: list from current site

Item ID (only if “For single item” selected): ID or expression to be evaluated as ID of the item we want to have as context in the document

Library (only if “Save to library” selected): target document library, where the generated document should be stored

Subfolder (only if “Save to library” selected): fixed subfolder path or dynamically calculated using an expression e.g. with placeholders

Filename: file name for generated document. fixed name or dynamically calculated using an expression e.g. with placeholders

Overwrite Existing File (only if “Save to library” selected): if checked and the file is already stored in the configured library, the old file will be overwritten.

Document Templates

Supported template format is docx. The template is created in Microsoft Word or other software that support the docx format.Currently skybow Document Generator allows inserting skybow placeholders, conditions, loops, nested loops and loops over table rows.

Start with [[if …]] and any kind of boolean Expression (Condition).Ends with [[end if]]

Everything between the starting and the endig tag will be visible if the condition is true. This can be a text, an image etc.

[[if [[Budget]] > [[Outgoings]] ]]

[[Title]]

[[end if]]

-------------------------------------------------------------

[[if {return ([[Budget]] > [[Outgoings]]);} ]]

[[Title]]

[[end if]]

Loops

Start with [[loop]] for looping over multiple items of selected list.

If CAML Query is configured for this action link, looping will be filtered according to it.

Start with [[loop SublistTitle]] for looping over the sublist items filtered by lookup to the parent list. If list that is not a sublist is selected (doesn’t have lookup to the list selected in action link configuration), no filtering will be applied.

Iteration ends with [[end loop]]

[[loop]]

[[Title]]

[[end loop]]

-------------------------------------------------------------

[[loop SubListTitle]]

[[Title]]

[[Firstname]]

[[end loop]]

Filtered Loops

Where 'SomeView' is a view .aspx page title:

The order and filter of the view are applied. If CAML query is added (optional), it is united with view query using an 'and' operator.