Skip to content

Conversation

@corypride
Copy link
Contributor

@corypride corypride commented Nov 13, 2025

Added full PDF report generation capability for user usage transcripts uses endpoint to generate PDF reports showing resident activity, program participation, and platform usage metrics, also added subreport tables showing program enrollment, class attendance, and completion status.

📁 Files Added/Modified:

Core Service Implementation:

  • backend/src/jasper/jasper_service.go - New service for PDF generation using JasperReports
  • backend/src/handlers/user_handler.go - used existing handler for PDF generation endpoint integration

Jasper Templates:

  • backend/src/templates/user_usage_report.jrxml - Main report template with logo, user info, and usage metrics
  • backend/src/templates/user_usage_programs_subreport.jrxml - Subreport for detailed program participation data
  • Compiled .jasper files for both templates

Infrastructure & Dependencies:

  • backend/go.mod - Added github.com/evertonvps/go-jasper dependency
  • backend/Dockerfile - Updated to include Java 17 JRE and JasperStarter setup
  • jasperstarter/ directory - Complete JasperStarter 3.6.2 distribution with all required libraries

🔧 Technical Implementation Details:

Report Features:

  • Professional PDF layout with UnlockED branding and logo
  • User information display (name, ID, facility, date range)
  • Platform usage metrics (total time spent, logins, resources accessed)
  • Program participation tables with attendance percentages
  • Date formatting and localization support
  • Error handling for missing program data

Data Processing:

  • JSON data source integration with Go backend
  • Temporary file management for JSON data and logo images
  • Automatic cleanup of temporary files
  • Subreport integration for program details
  • Attendance percentage calculations

🐳 Docker Infrastructure:

  • Multi-stage build (Go builder + Java runtime)
  • Eclipse Temurin JRE 17 Alpine base image
  • JasperStarter 3.6.2 integration
  • Proper path setup and wrapper scripts
  • SSL certificates and timezone info preservation

📊 Jasper Studio Version Compatibility:

Critical Note: As you mentioned, this implementation specifically addresses UUID compatibility issues:

  • Compatible Version: Jaspersoft® Studio 6.21.5 (Visual Designer for JasperReports 6.21.5)
  • Issue Avoided: Version 7.. had UUID compatibility problems that would cause compilation/runtime errors
  • Template Header: All JRXML files are tagged with "Created with Jaspersoft Studio version 6.21.5.final using JasperReports Library version 6.21.5-74d586df47b25dbd05bd0957999819196e59934a"

🔗 Integration Points:

  • User handler integration for /users/{id}/usage-report endpoint
  • Database queries for user data, program participation, and activity metrics
  • JSON data transformation for JasperReports consumption
  • Error handling and logging throughout the process

📝 Testing & Cleanup:

  • Comprehensive logging for debugging Jasper compilation and processing
  • Temporary file cleanup with proper error handling
  • Fallback mechanisms for template processing
  • Structured logging for monitoring and troubleshooting

This implementation provides a complete, production-ready JasperReports solution that's specifically designed to work with the 6.21.5 version to avoid the UUID compatibility issues you encountered with version 7.

@corypride corypride self-assigned this Nov 13, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation Backend labels Nov 13, 2025
@corypride corypride force-pushed the cpride/ticketID_493_jasper_reports_integration branch from c7ce903 to 6ca874e Compare November 13, 2025 20:06
@carddev81 carddev81 self-requested a review November 13, 2025 20:49
@corypride corypride force-pushed the cpride/ticketID_493_jasper_reports_integration branch 2 times, most recently from 1539691 to 4047ea9 Compare November 20, 2025 20:59
@corypride corypride marked this pull request as ready for review November 24, 2025 13:21
@corypride corypride requested a review from a team as a code owner November 24, 2025 13:21
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works good and the report looks great. Made some comments and suggestions

@corypride corypride force-pushed the cpride/ticketID_493_jasper_reports_integration branch 2 times, most recently from a6dc21d to 7ece04a Compare December 5, 2025 15:03
Copy link
Contributor

@carddev81 carddev81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and tested good. Hopefully we can build from this template, this is great!! We can figure out how to automate the compile process during build time :)

@carddev81 carddev81 requested a review from CK-7vn December 6, 2025 16:01
Copy link
Member

@CK-7vn CK-7vn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly little stuff, good job man! Quite the ticket to undertake, not going to lie, glad I didn't have to do it!

@carddev81 carddev81 requested a review from CK-7vn December 10, 2025 04:50
Copy link
Member

@CK-7vn CK-7vn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two small things, that I must have missed yesterday. Sorry.

@corypride corypride force-pushed the cpride/ticketID_493_jasper_reports_integration branch from 8703c8e to 0482947 Compare December 12, 2025 13:42
@corypride corypride requested a review from CK-7vn December 12, 2025 13:44
Copy link
Member

@CK-7vn CK-7vn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits, that aren't a big deal. Nice.

@carddev81 carddev81 force-pushed the cpride/ticketID_493_jasper_reports_integration branch from f8b746a to 5d54562 Compare December 18, 2025 18:16
@carddev81 carddev81 merged commit 6ce275f into main Jan 5, 2026
9 checks passed
@carddev81 carddev81 deleted the cpride/ticketID_493_jasper_reports_integration branch January 5, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend CI-Actions documentation Improvements or additions to documentation ProviderMiddleware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants