Skip to content

[Feature Request]: Native Export for Excel (.xlsx), PDF, and SVG – Modernizing Output Formats #314

@Foadsf

Description

@Foadsf

First off, I want to say that the existing MS Project XML and HTML exports are excellent and robust. However, in many corporate and industrial environments, they simply aren't enough.

The reality is that the business world runs on Microsoft Excel. While CSV support exists, it is insufficient for client-facing deliverables; it strips away the visual hierarchy, the Gantt chart visualization, and the formatting that makes the data readable. Similarly, PDFs remain the gold standard for immutable digital documentation, and SVGs are critical for embedding high-quality vector graphics into other reports.

This is not a new request. The community has been asking for these capabilities for over a decade:

Despite this long-standing demand, we are still relying on workarounds or external converters. I believe it is time to discuss what it would actually take to implement native support for these formats directly within the TaskJuggler Ruby codebase, rather than relying on external scripts.

The Proposal

We should aim to implement native exporters (:xlsx, :pdf, :svg) in TaskJuggler::Report.

Technical Challenges & Bottlenecks

I've been looking at the codebase structure to understand the feasibility. Here is a breakdown of the requirements and likely bottlenecks for each format:

1. Native Excel (.xlsx)

The Challenge:
CSV is easy because it's just text. Excel is a binary format (zipped XML). The main difficulty here is Visual Fidelity. We don't just want data; we want the Gantt chart bars, the indentation of the WBS, and the color coding.

  • Dependencies: We would likely need to introduce a Ruby gem like caxlsx (formerly axlsx) or rubyXL to handle the generation of the .xlsx file structure.
  • Rendering: The current GanttChart.rb logic relies heavily on HTML divs and CSS for positioning bars. This logic would need to be essentially rewritten to map time-scales to Excel columns and use Excel Shapes or conditional formatting to draw the bars.
  • Bottleneck: Mapping the pixel-perfect layout logic from Painter.rb into Excel's grid-based system.

2. PDF Export

The Challenge:
Pagination. The current HTML reports are continuous scrolling views. A PDF requires strict page breaking logic (both vertical for task lists and horizontal for long timelines).

  • Dependencies: We could use a library like Prawn (pure Ruby) or Grover (Puppeteer wrapper). Prawn keeps dependencies light but requires manually "drawing" every line of text and table, essentially duplicating the HTML layout engine work. Using a wrapper like Grover requires the user to have Node/Chromium installed, which increases the footprint significantly.
  • Bottleneck: Handling the "Gantt Header" scale across multiple pages is notoriously difficult in PDF generation without breaking the layout.

3. SVG Export

The Challenge:
This should theoretically be the easiest because TaskJuggler already has a Painter class that seems to support SVG primitives.

  • Bottleneck: It seems the SVG support is currently tightly coupled with the HTML report generation (embedded SVG). We would need to decouple the GanttChart render logic so it can output a standalone .svg file without the surrounding HTML container.

Discussion

Is there any appetite among the maintainers to introduce gems like caxlsx or Prawn into the core dependencies? If we want TaskJuggler to remain a viable alternative to MS Project in 2024 and beyond, native support for these "Gold Standard" formats is essential.

I'm interested to hear thoughts on the architecture for a "pluggable" export system that doesn't just rely on the intermediate HTML format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions