LimeReport is an open-source, multi-platform C++ report generator library written using the Qt framework. It is primarily built for software developers who want to add template-based print and reporting capabilities directly into their Qt applications.
The source code and updates can be tracked via the fralx/LimeReport GitHub repository. Key Features
Embedded Report Designer: Includes a built-in visual layout designer that functions like a standard graphics editor. Developers or end-users can build, drag, and drop reporting elements in real time.
Embedded Preview: Allows users to preview print pages inside the application before rendering the final output.
Flexible Data Sourcing: It can pull data natively by connecting to an SQL database or accept custom application data models using the QAbstractTableModel interface.
Layout Elements & Groups: Supports multiple band types (Page Header/Footer, Group Headers, Sub-details), text boxes with HTML formatting, images, geometric shapes, and automatic band height adjustments.
Scripting Support: Features an embedded script editor utilizing JavaScript engines (like QJSEngine) to dynamically format output data, compute math, and handle complex generation events.
Output Types: Formatted templates are stored compactly in XML format and can be sent directly to a physical printer or exported seamlessly as a PDF file. Core Architecture
LimeReport relies on pure Qt code, ensuring compatibility across Windows, Linux, and macOS. While natively written for C++ / Qt environments, community projects like the python-LimeReport GitHub page provide third-party Python bindings for developers working outside of C++. Implementation Example
Integrating the library requires loading your layout and setting data targets. In a C++ project using CMake or QMake, a typical implementation looks like this:
#include “lrreportengine.h” // Instantiate the engine LimeReport::ReportEnginereport = new LimeReport::ReportEngine(this); // Bind your application data model report->dataManager()->addModel(“my_data_list”, stringListModel, true); // Load the XML layout template file report->loadFromFile(“invoice_template.lrxml”); // Preview or Print the output report->previewReport(); Use code with caution.
fralx/LimeReport: Report generator for Qt Framework – GitHub
Leave a Reply