Skip to main content

Report Generation Module

Project description

PollyReports.py provides a set of classes for database report writing. It assumes that you are using Reportlab to do PDF generation, but can work with any “canvas-like” object as desired.

PollyReports provides the following framework for report generation:

A Report object has a data source bound to it at instantiation. One or more Band objects (at least, a detail Band) must be added to it, and then the generate() method will be called to process the data source. The data source must be an iterator that produces objects that can be accessed via [] operations, meaning mainly dict, list, and tuple types, i.e. the most common types of records returned by standard database modules. The detail band is generated() once for each row.

Band objects contain a list of Elements (generally at least one) which define how data from the row should be printed. An Element may print any normal data item or label and may be subclassed to handle other things like images. Generating a band in turn calls Element.generate() for each element, producing a list of Renderers with the first item in the list being the overall height of the band. The height is used to decide if the band will fit on the current page; if not, a new page will be created first. When the page is finally ready for the band, Renderer.render() will be called for each Renderer in the element list in order to actually render the data.

This version is written for Python 2.7, but should be easily adapted to Python 3.

Project details


Release history Release notifications

History Node

1.7.7

History Node

1.7.6

History Node

1.7.5

History Node

1.7.4

History Node

1.7.3

History Node

1.7.2

History Node

1.6.7

History Node

1.6.6

History Node

1.6.5

History Node

1.6.3

History Node

1.6.2

History Node

1.6.1

History Node

1.6

History Node

1.5.1

History Node

1.5

History Node

1.4

History Node

1.3

This version
History Node

1.2

History Node

1.1

History Node

1.0

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
PollyReports-1.2.tar.gz (16.6 kB) Copy SHA256 hash SHA256 Source None Jun 17, 2012

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