Report Print Formats

In version 4.1 we introduce Report Print Formats. These are HTML templates that you can use to format Query Report data for printing.

1. Creating New Print Formats

To create a new Print Format, just drop in a .html file in the folder of the query report. For example, for the General Ledger report in ERPNext, you can drop in a file called general_ledger.html along side the .js and .py files.

Tree Of erpnext/accounts/general_ledger
general_ledger/
├── __init__.py
├── general_ledger.html
├── general_ledger.js
├── general_ledger.json
└── general_ledger.py

2. Templating

For templating, we use an adapted version of John Resig's microtemplating script . If you know Javascript, it is very easy to follow this templating language.

Here are some examples (from John Resig's Blog):

Example: Properities:

<div class="&lt;%=(i % 2 == 1 ?" id="&lt;%=id%&gt;">"&gt;
    <div class="grid_1 alpha right">

On this page