Skip to content

Comments

Enable PDF generation for “Generate Detailed Report” button in Sustainability Assessment#1580

Merged
omroy07 merged 1 commit intoomroy07:mainfrom
Aarya-Chaudhari:report
Feb 20, 2026
Merged

Enable PDF generation for “Generate Detailed Report” button in Sustainability Assessment#1580
omroy07 merged 1 commit intoomroy07:mainfrom
Aarya-Chaudhari:report

Conversation

@Aarya-Chaudhari
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

The “Generate Detailed Report” button in the Sustainability Assessment section was only displaying a notification instead of generating an actual PDF report. This created a gap between user expectations and functionality, as users expect a downloadable structured report after completing the assessment.

This change ensures the feature works as intended by implementing real client-side PDF generation, aligning the behavior with the issue’s expected outcome and improving overall usability and feature completeness.

What changes are included in this PR?

Added jsPDF CDN to enable client-side PDF generation
Replaced the placeholder generateReport() function that only showed a notification

Implemented dynamic PDF generation using:
Sustainability score
Assessment inputs (farm size, practices, water usage, organic usage, energy efficiency)
Recommendations section

Enabled automatic download of a structured PDF report on button click
Preserved existing UI, loading overlay, and notification system (no layout changes)
Ensured compatibility with both dark and light theme modes

Are these changes tested?

Yes. The changes were manually tested by:
Opening the Sustainable Farming Guidance page
Completing the Sustainability Assessment using different slider values
Clicking “Assess My Sustainability”
Clicking “Generate Detailed Report”

Are there any user-facing changes?

Yes.

Previously:
Clicking “Generate Detailed Report” only showed a notification with no actual report.

Now:
Clicking the button generates and downloads a structured PDF sustainability report containing the user’s assessment results and recommendations.

Screenshot 2026-02-20 145909 Screenshot 2026-02-20 145922

@vercel
Copy link

vercel bot commented Feb 20, 2026

@Aarya-Chaudhari is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@Aarya-Chaudhari
Copy link
Contributor Author

Hello @omroy07
I have raised a PR resolving issue #1577 and have also resolved merge conflicts.
Please review and let me know if any changes needed

@omroy07 omroy07 merged commit 99cfec0 into omroy07:main Feb 20, 2026
2 of 6 checks passed
@github-actions
Copy link

🎉 Congrats @Aarya-Chaudhari on getting your PR merged! 🙌
Thanks for the contribution — looking forward to more from you 🚀

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.

“Generate Detailed Report” Button Does Not Produce PDF Report

2 participants