Enable PDF generation for “Generate Detailed Report” button in Sustainability Assessment#1580
Merged
omroy07 merged 1 commit intoomroy07:mainfrom Feb 20, 2026
Merged
Conversation
|
@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. |
Thanks for creating a PR for your Issue!
|
Contributor
Author
|
🎉 Congrats @Aarya-Chaudhari on getting your PR merged! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.