-
Notifications
You must be signed in to change notification settings - Fork 308
Design Document: Export to Excel
We'd like to be able to export GanttProject data to Excel files in addition to already existing CSV export. This document describes user interface and technical aspects of the implementation.
In short, the task comes down to relatively small refactoring of the core CSV exporting code and enhancing its UI part with file type chooser.
Currently user can choose CSV export option in the list of all export options. We'd like CSV and Excel exports to be a single option called "Export to Spreadsheet" with the ability to choose file type. This is similar to Export to image which is a single option with a dropdown for choosing PNG or JPEG file type.
We also want to keep a single page "Spreadsheet" in the settings dialog, with a separate section specific to CSV export and task/resource field lists shared between CSV and Excel exports.
CSV export uses Apache Commons CSV library and in particular its CSVPrinter
class. There is a lot of non-trivial code in the export which we want to keep and don't want to duplicate. It seems that replacing CSVPrinter
with some abstract interface and parameterizing CSV exporter with implementation of that interface will make possible to reuse the code of exporter for both CSV and Excel exports.
We prefer Apache POI
library for writing Excel files, because it is already used in GanttProject.
Relevant classes in GanttProject codebase:
-
GanttCSVExport
-- the meat of CSV export, walks the project data, builds cell values and writes them usingCSVPrinter
-
ExporterToCSV
-- plugs into the export wizard UI -
ExporterToImage
-- sibling exporter which allows for choosing file type
This feature should eventually be merged into master
and published in one of the future versions. The base integration branch for pull requests is prj2_master
. Please target on using Java 8.
The process is described on GanttProject doc pages. Please do follow the code style and code review process.