Skip to main content

Tryton Webkit Report

Project description

Webkit based PDF report engine

https://travis-ci.org/openlabs/trytond-report-webkit.png?branch=develop

This package allows you to build HTML based reports and then convert them into PDFs using wkhtmltopdf which uses the webkit rendering engine and QT. (WebKit is the engine of Apples Safari).

The templates are written using Genshi. Though Genshi is not our favorite templating engine, it is a package tryton core depends on, and the authors did not want to add another template engine as its dependency. Genshi comes with a fairly good tutorial.

Using this in your projects

Instead of using the default report class from trytond.report use the ReportWebkit class from this package instead.

from openlabs_report_webkit import ReportWebkit

class UserReport(ReportWebkit):
    __name__ = 'res.user'

Output Formats

To get PDF outputs (instead of standard html) ensure that the report definition in xml clearly shows the extension as PDF. This could be changed from the tryton administration section too.

Adding as a dependency

You can add the report toolkit as a dependent package of your tryton module by adding into the install_requires list on your setup.py script. Remember to specify the version numbers carefully, or the latest version of the package available would be installed.

For example if your module is for version 2.6 of tryton, the line to add would be

install_requires = [
    ...,
    'openlabs_report_webkit>=2.6,<2.7'
    ...,
]

Gotchas!

The report file is missing

  • Did you add the template file to the package_data in your setup.py ?
  • Did you add the template file extension to the included files in MANIFEST ?

PDF generation problems

  • Check if wkhtmltopdf works well: Installing it simply via sudo apt-get install wkhtmltopdf on Ubuntu for exmaple will install a reduced functionality version which is probably not what you want.

Project details


Release history Release notifications

History Node

4.0.1.1

History Node

4.0.1.0

History Node

4.0.0.4

History Node

4.0.0.3

History Node

4.0.0.2

History Node

4.0.0.1

History Node

3.6.0.2

History Node

3.4.1.1

History Node

3.4.1.0

History Node

3.4.0.4

History Node

3.4.0.3

History Node

3.4.0.2

History Node

3.2.0.4

History Node

3.2.0.3

History Node

3.2.0.2

This version
History Node

3.2.0.1

History Node

3.0.3.0

History Node

3.0.2.1

History Node

3.0.2.0

History Node

3.0.1.0

History Node

2.6.2.0

History Node

2.6.1.0

History Node

2.6.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
openlabs_report_webkit-3.2.0.1.tar.gz (3.9 kB) Copy SHA256 hash SHA256 Source None Jul 30, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page