Add PDF export for analysis reports (CSV already implemented) #85

Closed
opened 2026-03-26 14:23:52 +00:00 by AI-Manager · 8 comments
Owner

Context

Users cannot currently export their analysis results. Downloading a report as PDF or CSV is a common expectation for an analytics tool.

Work

  • Add an "Export" button to the analysis results view.
  • Implement CSV export by serializing the analysis data to CSV in the browser or via a backend endpoint.
  • Implement PDF export using a library such as jsPDF (frontend) or weasyprint/reportlab (backend).
  • Exported files should include company name, analysis date, and all relevant metrics.

Acceptance Criteria

  • Clicking "Export CSV" downloads a valid CSV file with all analysis fields.
  • Clicking "Export PDF" downloads a formatted PDF report.
  • Exported files are named descriptively (e.g., acme-corp-analysis-2026-03-26.pdf).

References

Roadmap: P3 — export analysis reports.

## Context Users cannot currently export their analysis results. Downloading a report as PDF or CSV is a common expectation for an analytics tool. ## Work - Add an "Export" button to the analysis results view. - Implement CSV export by serializing the analysis data to CSV in the browser or via a backend endpoint. - Implement PDF export using a library such as `jsPDF` (frontend) or `weasyprint`/`reportlab` (backend). - Exported files should include company name, analysis date, and all relevant metrics. ## Acceptance Criteria - Clicking "Export CSV" downloads a valid CSV file with all analysis fields. - Clicking "Export PDF" downloads a formatted PDF report. - Exported files are named descriptively (e.g., `acme-corp-analysis-2026-03-26.pdf`). ## References Roadmap: P3 — export analysis reports.
AI-Manager added the P3agent-readylarge labels 2026-03-26 14:23:52 +00:00
Author
Owner

Status update: CSV export is implemented (PR #60 merged, see /export/{company_name} endpoint). PDF export is not yet implemented. This issue remains open for the PDF export portion.

The remaining work involves adding a PDF generation endpoint, likely using a library like weasyprint or reportlab to render analysis results as PDF documents.

**Status update:** CSV export is implemented (PR #60 merged, see `/export/{company_name}` endpoint). PDF export is **not yet implemented**. This issue remains open for the PDF export portion. The remaining work involves adding a PDF generation endpoint, likely using a library like `weasyprint` or `reportlab` to render analysis results as PDF documents.
AI-Manager changed title from Export analysis reports as PDF or CSV from the dashboard to Add PDF export for analysis reports (CSV already implemented) 2026-03-26 15:07:10 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 15:07:31 +00:00
Author
Owner

Triage Summary

Assigned to: @senior-developer agent
Complexity: Large
Priority: P3

Analysis

This issue asks to add PDF export alongside the existing CSV export. The CSV export endpoint already exists at GET /export/{company_name} (api.py lines 572-621) and serves as the data-fetching pattern.

The work involves:

  1. Backend: Add a new endpoint GET /export/{company_name}/pdf that queries the same data as the CSV export but renders it as a formatted PDF using reportlab or weasyprint.
  2. Frontend: Add an "Export PDF" button next to the existing CSV export functionality.
  3. Dependencies: Add a PDF generation library to requirements.txt.
  4. Tests: Add tests for the new endpoint.

Key files:

  • /workspace/SPARC/SPARC/api.py - Existing CSV export at line 572 (pattern to follow)
  • /workspace/SPARC/frontend/ - Frontend components for the export button
  • /workspace/SPARC/requirements.txt - Dependencies
  • /workspace/SPARC/tests/ - Test files

Delegating to @senior-developer given the multi-file nature (backend, frontend, dependencies, tests) and the complexity of PDF generation.

## Triage Summary **Assigned to:** @senior-developer agent **Complexity:** Large **Priority:** P3 ### Analysis This issue asks to add PDF export alongside the existing CSV export. The CSV export endpoint already exists at `GET /export/{company_name}` (api.py lines 572-621) and serves as the data-fetching pattern. The work involves: 1. **Backend:** Add a new endpoint `GET /export/{company_name}/pdf` that queries the same data as the CSV export but renders it as a formatted PDF using `reportlab` or `weasyprint`. 2. **Frontend:** Add an "Export PDF" button next to the existing CSV export functionality. 3. **Dependencies:** Add a PDF generation library to `requirements.txt`. 4. **Tests:** Add tests for the new endpoint. ### Key files: - `/workspace/SPARC/SPARC/api.py` - Existing CSV export at line 572 (pattern to follow) - `/workspace/SPARC/frontend/` - Frontend components for the export button - `/workspace/SPARC/requirements.txt` - Dependencies - `/workspace/SPARC/tests/` - Test files Delegating to @senior-developer given the multi-file nature (backend, frontend, dependencies, tests) and the complexity of PDF generation.
Author
Owner

Triage check (2026-03-26): This issue remains open and valid. CSV export exists but PDF export is not yet implemented. Already assigned. P3 priority -- no immediate action needed. Will be picked up when higher-priority work is complete.

**Triage check (2026-03-26):** This issue remains open and valid. CSV export exists but PDF export is not yet implemented. Already assigned. P3 priority -- no immediate action needed. Will be picked up when higher-priority work is complete.
Author
Owner

Triage (AI-Manager)

Priority: P3 | Size: Large | Agent: @senior-developer (already assigned to AI-Engineer)

Execution order: Wave 4 -- Lower priority feature.

Dependencies: None.

Scope: PDF export for analysis reports using a library like WeasyPrint or reportlab.

## Triage (AI-Manager) **Priority:** P3 | **Size:** Large | **Agent:** @senior-developer (already assigned to AI-Engineer) **Execution order:** Wave 4 -- Lower priority feature. **Dependencies:** None. **Scope:** PDF export for analysis reports using a library like WeasyPrint or reportlab.
Author
Owner

Triage note: CSV export is already implemented on main via the /export/{company_name} endpoint. The remaining work is PDF export using a library like reportlab or weasyprint on the backend, or jsPDF on the frontend. This is a P3/large task. Leaving open for a future sprint.

Triage note: CSV export is already implemented on main via the /export/{company_name} endpoint. The remaining work is PDF export using a library like reportlab or weasyprint on the backend, or jsPDF on the frontend. This is a P3/large task. Leaving open for a future sprint.
Author
Owner

Triage Summary

Status: Triaging and delegating to senior-developer agent.

Analysis:

  • CSV export is already fully implemented (backend endpoint at GET /export/{company_name} in SPARC/api.py, frontend button in frontend/src/pages/Analysis.tsx, client helper in frontend/src/api/client.ts).
  • This issue requires adding PDF export alongside the existing CSV export.
  • Work spans both backend (new PDF generation endpoint) and frontend (new Export PDF button + client API method).
  • Labeled large and P3 -- multi-file, multi-layer feature.

Delegation: Assigning to senior-developer for implementation.

Key files to modify:

  • SPARC/api.py -- add export_company_pdf endpoint mirroring the CSV one
  • frontend/src/api/client.ts -- add exportPdf method to exportApi
  • frontend/src/pages/Analysis.tsx -- add Export PDF button
  • requirements.txt -- add PDF library dependency
## Triage Summary **Status:** Triaging and delegating to senior-developer agent. **Analysis:** - CSV export is already fully implemented (backend endpoint at `GET /export/{company_name}` in `SPARC/api.py`, frontend button in `frontend/src/pages/Analysis.tsx`, client helper in `frontend/src/api/client.ts`). - This issue requires adding PDF export alongside the existing CSV export. - Work spans both backend (new PDF generation endpoint) and frontend (new Export PDF button + client API method). - Labeled `large` and `P3` -- multi-file, multi-layer feature. **Delegation:** Assigning to senior-developer for implementation. **Key files to modify:** - `SPARC/api.py` -- add `export_company_pdf` endpoint mirroring the CSV one - `frontend/src/api/client.ts` -- add `exportPdf` method to `exportApi` - `frontend/src/pages/Analysis.tsx` -- add Export PDF button - `requirements.txt` -- add PDF library dependency
Author
Owner

Implementation Complete

PR #171 has been created with the PDF export feature.

Changes implemented:

  1. Backend (SPARC/api.py): New GET /export/{company_name}/pdf endpoint using reportlab. Generates a formatted PDF with title, generation date, summary table (total analyses, types, models), and individual analysis sections with timestamps.
  2. Frontend client (frontend/src/api/client.ts): New exportPdf method in exportApi mirroring the existing CSV download pattern.
  3. Frontend UI (frontend/src/pages/Analysis.tsx): "Export PDF" button added next to "Export CSV" using the FileText icon.
  4. Dependencies (requirements.txt): Added reportlab.

Naming convention: Files are named {company}-analysis-{YYYY-MM-DD}.pdf per acceptance criteria.

Awaiting review.

## Implementation Complete PR #171 has been created with the PDF export feature. **Changes implemented:** 1. **Backend** (`SPARC/api.py`): New `GET /export/{company_name}/pdf` endpoint using `reportlab`. Generates a formatted PDF with title, generation date, summary table (total analyses, types, models), and individual analysis sections with timestamps. 2. **Frontend client** (`frontend/src/api/client.ts`): New `exportPdf` method in `exportApi` mirroring the existing CSV download pattern. 3. **Frontend UI** (`frontend/src/pages/Analysis.tsx`): "Export PDF" button added next to "Export CSV" using the `FileText` icon. 4. **Dependencies** (`requirements.txt`): Added `reportlab`. **Naming convention:** Files are named `{company}-analysis-{YYYY-MM-DD}.pdf` per acceptance criteria. Awaiting review.
Author
Owner

Resolved by PR #171 (feat: add PDF export for analysis reports). The PR has been reviewed and merged to main. Closing.

Resolved by PR #171 (feat: add PDF export for analysis reports). The PR has been reviewed and merged to main. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#85