Skip to content

feat: add Export to PDF button for expense reports Closes #12#62

Merged
MeenakshiAM merged 2 commits into
MeenakshiAM:mainfrom
adithyen:Export-Report-to-PDF-#12
Mar 1, 2026
Merged

feat: add Export to PDF button for expense reports Closes #12#62
MeenakshiAM merged 2 commits into
MeenakshiAM:mainfrom
adithyen:Export-Report-to-PDF-#12

Conversation

@adithyen
Copy link
Copy Markdown
Contributor

@adithyen adithyen commented Mar 1, 2026

📌 Description

Brief description of what this PR does.
Adds an "Export to PDF" button next to the monthly total that generates a clean, professional PDF report of the user's expense data. Uses jsPDF + jspdf-autotable (loaded via CDN) for client-side PDF generation — no server-side changes needed.

🔗 Related Issue

Closes #12


🛠 Changes Made

  • Added jsPDF and jspdf-autotable CDN scripts to index.html
  • Added "📄 Export to PDF" button next to the Selected Month Total
  • Added exportToPDF() function in script.js that generates a PDF with:
    • Report title and generation date
    • Active filter info (month, category)
    • Expense table with all currently displayed data
    • Category-wise summary table
    • Budget status (exceeded / approaching / within limit)
    • Page footers with page numbers
  • Added .export-btn styling in style.css (blue button, dark mode support)
  • PDF filename is dynamic: expenses_YYYY-MM.pdf when filtered by month, otherwise expenses_report.pdf

📷 Screenshots (if applicable)

image image image

✅ Checklist

  • I have tested my changes
  • My code follows project guidelines
  • I have linked the related issue

@MeenakshiAM MeenakshiAM merged commit 7d65c04 into MeenakshiAM:main Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export Report to PDF

2 participants