All Projects → ngs-doo → TemplaterExamples

ngs-doo / TemplaterExamples

Licence: Unlicense License
Creating reports in .NET and Java

Programming Languages

C#
18002 projects
java
68154 projects - #9 most used programming language
HTML
75241 projects
ASP.NET
160 projects
scala
5932 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to TemplaterExamples

Sonar Cnes Report
Generates analysis reports from SonarQube web API.
Stars: ✭ 145 (+291.89%)
Mutual labels:  reporting, xlsx, docx
Desktopeditors
An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
Stars: ✭ 1,008 (+2624.32%)
Mutual labels:  xlsx, docx
docxmustache
laravel 8.x docx template manipulation class, based on mustache templating language
Stars: ✭ 34 (-8.11%)
Mutual labels:  reporting, docx
Documentserver
ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Stars: ✭ 2,335 (+6210.81%)
Mutual labels:  xlsx, docx
Msoffcrypto Tool
Python tool and library for decrypting MS Office files with passwords or other keys
Stars: ✭ 274 (+640.54%)
Mutual labels:  xlsx, docx
Kodexplorer
A web based file manager,web IDE / browser based code editor
Stars: ✭ 5,490 (+14737.84%)
Mutual labels:  xlsx, docx
Hrconvert2
A self-hosted, drag-and-drop, & nosql file conversion server that supports 62x file formats.
Stars: ✭ 132 (+256.76%)
Mutual labels:  xlsx, docx
Documentbuilder
ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
Stars: ✭ 61 (+64.86%)
Mutual labels:  xlsx, docx
kodbox
kodbox is a file manager for web. It is a newly designed product based on kodexplorer. It is also a web code editor, which allows you to develop websites directly within the web browser.You can run kodbox either online or locally,on Linux, Windows or Mac based platforms
Stars: ✭ 1,188 (+3110.81%)
Mutual labels:  xlsx, docx
Openvasreporting
OpenVAS Reporting: Convert OpenVAS XML report files to reports
Stars: ✭ 42 (+13.51%)
Mutual labels:  reporting, xlsx
Unioffice
Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents
Stars: ✭ 3,111 (+8308.11%)
Mutual labels:  xlsx, docx
sarna
Security Assessment Report geNerated Automatically
Stars: ✭ 26 (-29.73%)
Mutual labels:  reporting, docx
Gotenberg
A Docker-powered stateless API for PDF files.
Stars: ✭ 3,272 (+8743.24%)
Mutual labels:  xlsx, docx
Quip Export
Export all folders and documents from Quip
Stars: ✭ 28 (-24.32%)
Mutual labels:  xlsx, docx
redmine preview office
Plugin for Redmine. Preview Microsoft Office Documents in Redmine's preview pane
Stars: ✭ 27 (-27.03%)
Mutual labels:  xlsx, docx
Docx Templates
Template-based docx report creation
Stars: ✭ 382 (+932.43%)
Mutual labels:  reporting, docx
opentbs
With OpenTBS you can merge OpenOffice - LibreOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use OpenOffice - LibreOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats. That is the Natural Template philosophy.
Stars: ✭ 48 (+29.73%)
Mutual labels:  xlsx, docx
modern-office-git-diff
An experiment in tracking and diffing versions of modern Microsoft Office files in Git.
Stars: ✭ 51 (+37.84%)
Mutual labels:  xlsx, docx
jmeterReports
Jmeter autogenerater reports after test to Confluence, using grafana custom dushboards.
Stars: ✭ 23 (-37.84%)
Mutual labels:  reporting
svelte-sheets
Blazing fast excel sheets in the browser, hugely inspired by JExcel, built with Svelte and XLSX.
Stars: ✭ 45 (+21.62%)
Mutual labels:  xlsx

Reporting for JVM and .NET

Templater is a reporting library which can be easily integrated into third party apps as advanced document generation engine. It works by binding provided data with specified template. Main goal is to provide customization options outside of development, so that reports/invoices/quotes and various other type of documents can be made to look as customers needs them.

Library has a minimal interface for providing data and various extension points for exposing specialized features not available in the library. This way same code is reused across all document generation, instead of having document being generated by writing special code just for that document.

These examples show various usages of the library.

Additional documentation is available from the official website.

How Templater works

Templater works by analyzing provided docx/xlsx/pptx/csv document for tags. Tags are snippets of text written in either [[tag]], {{tag}} or a <<tag>> format. Tags can have metadata which can be used for various customization purposes, such as formatting, verbalization and others.

Tags placed in a resizable part of the document can be duplicated by Templater when paired with a collection input. Major difference from other templating solution is that repeating of a collection is implicit from tag definition instead of explicit by using for loop constructs. An example of this is a row in a table, list, page, sheet or the entire document.

Templater uses documents prepared in Microsoft Office (or some other editor), which allows for beautiful documents, without the need for writing code. This works great in most cases, although Templater must infer intention for the behavior from the structure of the document/tags.

Templater has minimal API for interaction:

  • high level process method
  • low level replace, resize and clone

and a builder API for customization.

Usage of Templater mostly consists from passing existing model to high level API.

Template Result

Data types

Most data types are processed by Templater with conversion to string. In Excel some types are converted into native Excel formats, such as numbers and dates.

Collections are usually processed by duplicating context which encapsulates all tags matching that collection.

Templater will use reflection to analyze classes, but it can work also on dynamic data types such as dictionary/map.

Templater has special behavior for several data types, such as:

and several others (DateTime, multiline strings, ...).

Resizing

Low level resize(tags, count) API is used for duplicating part of the document. It can work for simple cases, such as single row in a table, but can be used for more complex ones:

  • multiple rows - tags can span multiple rows, which will cause multi-row copying
  • nested elements - tags can span multiple tables/lists which can be used for cloning complex document layouts
  • formula rewriting - as formulas are moved around and copied, their expressions will be adjusted accordingly
  • row/column styles - if possible styles will be maintained during horizontal or vertical resizing (horizontal resizing requires horizontal-resize metadata)
  • pushdown/pushright - elements bellow/right of tags area will be moved according to builtin rules
  • merge cells/named ranges/tables - influence push rules by extending the affected region
  • XML binding - custom XML will be changed/updated when bound in Word

Examples

This repository contains various examples covering some of the features:

Extensibility

Templater has several extensibility points. Various plugins are embedded into library, while others can be registered during library initialization.

Examples:

FAQ

Q: How can I inject text with special color/bolding instead of plain (or pre-formatted) text into Templater?
A: You need to use XML to inject rich text into document (and format it appropriately to the target document format).

Q: Can I convert docx/xlsx/pptx to PDF?
A: Templater does not support converting documents to PDF. If MS Office can't be used to do PDF conversion there are various 3rd party libraries such as Aspose or Spire for PDF conversion. For low budget solutions headless LibreOffice can be used. Almost all non MS solutions have some pixel perfect issues :(. To ease the usage of LibreOffice there is a Dockerfile which will prepare the environment for easy PDF conversion. Templater does support digital signatures and can sign documents as an alternative to PDF in some cases

Q: Is this just a fancy mail-merge library?
A: Not at all. Templater can create really complex documents, but you might need to have a good knowledge of Word/Excel/PowerPoint to create such complex documents.

Q: How does Templater compare to Microsoft OOXML SDK?
A: OOXML SDK is a low level abstraction over Office document formats, while Templater is a high level abstraction over populating documents with data. Templater goal is to avoid writing code for creating reports, but instead bind provided data with an existing template.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].