In recent months, we have been working on a project that we are proud to present. Using Drupal 7, we developed a system to import, view, and download financial reports in various Excel formats, including macros. This project involved extensive planning to ensure a scalable structure for content management, allowing the project to grow easily over time.
To facilitate data import, we created a form that processes XML files with multiple records, generating nodes for each record in the XML. For each data record, we referenced fields from the XSD structure designed for each financial report.
The import process includes three stages of validation:
All validation messages—whether errors or successes—are logged in Watchdog to create a comprehensive validation record. Additionally, the import system includes a versioning module, enabling historical reporting and reversible versions. We implemented complex field collection logic to track changes, detect new records, and identify removed records to create new versions when needed.
To display reports, we developed custom formats for each type of content. This involved modifying TPL files and processing data before rendering it, allowing each report format to meet specific requirements. Some reports required data manipulation with formulas or rearranged information for clarity.
We developed a form for report downloads, allowing users to select various views that are managed in code. Views were chosen for their future scalability, as these queries will likely grow over time. We used PHP Views with static variables, enabling PHP code to interact with data dynamically.
To download reports in Excel format, we utilized the PHPExcel library, which enabled us to interact with and inject data into Excel files. With PHPExcel, we incorporated macros for data manipulation within specific sheets. While we encountered initial challenges using macros with the library, we resolved these issues to achieve the desired functionality.
This project includes additional features, such as:
This project represents a unique development with Drupal, showcasing a versatile, scalable approach to financial report management with robust import, view, and download capabilities.