ReportLab Tutorials

Up and running with ReportLab in minutes. These tutorials use Django 1.6+. 

Product Catalogue

ReportLab is a natural choice for converting any kind of XML feed into beautiful print-ready publications.

This example shows how to take an XML description of products available in an online store and use it to create up-to-date brochures and checklists. Learn how text, data and images can be easily included and the powerful layout options ReportLab gives.

The principles learnt could easily be extended into more complex documents.

See more...



Hedge Fund Report

Complex financial reports are a breeze with ReportLab. See how to pull a range of financial data from a Django application to produce a report, including complex tables and custom data graphics.

Learn how ReportLab can dynamically display data the way you want it to, and get a taste for the almost limitless design options possible. 

See more...

Convert HTML to RML

from preppy import SafeString
from rlextra.radxml.xhtml2rml import xhtml2rml
from rlextra.radxml.html_cleaner import cleanPlain


data = "<p>This is raw data with <em>HTML</em> <b>paragraph</b></p>"
data2 = "This is raw data with <em>HTML</em> <b>paragraph</b>"

1: Raw XHTML data example; preppy quoting escapes the tags


2: cleanPlain Strips XHTML tags example

<para style="normal">{{cleanPlain(data)}}</para>

3: XHTML data without para tags but with inline tags, ensure the data is enclosed in an RML para tag
    SafeString tells preepy not to xml escape the contents
    xhtml2rml converts the XHTML to RML

<para style="normal">{{SafeString(xhtml2rml(data2))}}</para>

4: XHTML to RML data example - without a specified paraStyle, ensure there are no RML para tags around the data.
    When there no paraStyles specified with the content, xhtml2rml assumes paraStyle='normal', tableStyle='noPaddingStyle', bulletStyle='bullet' exists in your style sheets

5: XHTML to RML data example - with a specified paraStyle, ensure there are no RML para tags around the data
{{SafeString(xhtml2rml(data, paraStyle="normal"))}}



Invoices (Coming soon)

Everyone likes getting paid, but no one likes creating invoices. Luckily, ReportLab makes it possible to completely automate their production.

Coming soon...