Reporting Library

As part of a broader transition from legacy Access-based systems, we found ourselves having to move over a large library of rich reports to ReportLab, the popular Python PDF library. Along with those, we also have to deal with frequent requests for additional reports. While ReportLab includes Platypus to provide higher-level PDF composition, this still requires a significant amount of setup code just to get a dynamic page footer going, for example.

To address these issues, I developed a rich reporting library that provides an abstract set of components (e.g., sections, labels, images) to more easily create reports. Since our PDF reports are often also made available as Excel spreadsheets, the library handles creating either from the same data set. To convert the existing Access reports, I created a set of scripts to generate their equivalent Python code using this library as a base.

Besides greatly simplifying the report creation process, having this central reporting library has also allowed us to easily handle additional twists, such as Arabic’s right-to-left formatting and Thai’s space-less line wrapping.

Key Technologies: