Skip to content

[FE-41] Build /reports page — generate and download portfolio export as PDF or Excel #853

Description

@mftee

Overview

Users need to export their entire document portfolio for offline analysis, legal submissions, or regulatory compliance. The backend exposes GET /api/documents/export/excel and individual document PDF exports (BE-77). The reports page brings these together in a user-friendly interface.

Background

File to create: frontend/app/(protected)/reports/page.tsx

Features:

Portfolio export section:

  • "Download as Excel (.xlsx)" button → calls GET /api/documents/export/excel
  • "Download as PDF" button → calls GET /api/documents/export/pdf (if a portfolio-level PDF is implemented) or generates one client-side using jspdf
  • Date range filter to scope the export (optional)
  • Status filter (only export VERIFIED documents, etc.)

Individual document reports section:

  • Same as the document list (FE-16) but with a prominent "Download Report" button per row
  • "Download all as ZIP" (stretch goal) — zips individual PDFs client-side or requests a batch export

Usage note:

  • Show last export timestamp to help users avoid re-downloading unchanged data

Acceptance Criteria

  • Excel export triggers a .xlsx file download from the backend
  • PDF export triggers a PDF download
  • Downloads show a loading state in the button while the backend generates the file
  • Date range and status filters are applied as query params to the export endpoint
  • Error state shown if the export fails (e.g., no documents match the filter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions