Skip to main content

Reports

This document covers the desktop client's report subsystem: the ReportType enum that defines all supported reports, the ReportGroup categories, the AbstractReportUserInterface base class, individual report implementations, and the ReportGenerationHelper that drives report generation.


Module Location

All desktop-side report classes live in: suredms-desktop-client/src/main/java/com/sureclinical/suredms/report/

The ReportType enum and shared context types live in: suredms-report/src/main/java/com/sureclinical/suredms/report/context/


ReportGroup — Report Category Groupings

ReportGroup is an enum that groups reports by functional area and ties each group to a feature flag constant:

GroupFeature flag
ADMINISTRATIONFEATURE_GLOBAL_ADMINISTRATIVE_REPORTS
CONTENTFEATURE_GLOBAL_CONTENT_REPORTS
NETWORK(no feature gate)
MANAGEMENT"EDIT_PROJECT_REPORTS"
QUALITYFEATURE_SURE_QMS_EDIT_QUALITY_MANAGEMENT_REPORTS
OTHER(no feature gate)

Reports only appear in the UI if the associated feature group is enabled for the current user's license and configuration.


ReportType — All Report Definitions

ReportType is an enum in suredms-report. Each value declares a display name, a short description, whether it is a server-only (web) report (serverOnly=true), an optional UI implementation class name, and its ReportGroup.

Administration group

Enum valueDisplay nameUI class
BARCODE_COVER_SHEETBarcode Cover SheetReportBarcodeCoverSheetType
SYSTEM_USER_BY_INSTANCESystem Users By InstanceReportSystemUsersByInstance
ARCHIVES_BY_INSTANCEArchives By Instance(server-only)
PROJECTS_BY_INSTANCEProjects By Instance(server-only)
SYSTEM_USER_BY_ARCHIVESystem Users By Archive(server-only)
SYSTEM_USER_BY_LICENSESystem Users By License(server-only)
ORGANIZATIONS_BY_ARCHIVEOrganizations By ArchiveReportOrganizationsByArchive
USER_AUDIT_TRAILUser Audit TrailReportUserAuditTrail
USER_ACCESS_BY_ARCHIVEUser Access By ArchiveReportUserAccessByArchive
USER_GROUPSUser Groups(server-only)
CONTACTS_BY_ARCHIVEPersons By ArchiveReportPersonsByArchive
SIGNING_AUDIT_TRAILSigning Audit TrailReportSigningHistoryAuditTrail ¹
USER_ROLEUser RolesReportUserRoles
APPLICATION_ROLEApplication RolesReportApplicationRoles
TRAINING_CERTIFICATESTraining CertificatesReportTrainingCertificate

¹ In suredms-desktop-client-signing.

Content group

Enum valueDisplay nameUI class
CONTENT_BY_QUALITY_CHECKDocuments by Quality Check StatusReportDocumentsByQualityCheck
CONTENT_MODELContent ModelReportContentModelType
DISCREPANCY_REPORTDiscrepancy ReportReportDocumentDiscrepancy
SIGNATURE_VALIDATIONSignature Validation ReportReportSignatureValidation ¹
WORKFLOWS_PLATFORMWorkflow ReportWorkflowReportData ²
ARCHIVE_AUDITAudit ReportReportArchiveAudit
ARCHIVE_MANIFESTExport Archive Manifest ReportReportDocumentsAdvanced
FILE_MIGRATIONDocuments Migration Report(server-only)
SITE_MONITOR_CHECKSSite Monitor Checks Report(server-only)
SHARED_DOCUMENT_BY_SITEShared Documents by Site Report(server-only)

¹ In suredms-desktop-client-signing. ² In suredms-workflow-platform.

Other group

Enum valueDisplay nameUI class
CONTENT_BY_CONTENT_TYPEDocuments By Content TypeReportDocumentsAdvanced
CONTENT_BY_ORGANIZATIONDocuments By OrganizationReportDocumentsAdvanced
CONTENT_BY_ORGANIZATION_ROLEDocuments By Organization RoleReportDocumentsAdvanced
CONTENT_BY_PERSONDocuments By PersonReportDocumentsAdvanced
CONTENT_BY_PERSON_ROLEDocuments By Person RoleReportDocumentsAdvanced
CONTENT_BY_SITEDocuments By SiteReportDocumentsAdvanced
CONTENT_BY_STUDY_SUBJECT_AND_VISIT_NUMBERDocuments By Study Subject and Visit NumberReportDocumentsAdvanced
CONTENT_BY_EXPIRATION_DATEExpiring Document ReportReportDocumentsExpirationDate
DOCUMENT_COMPLETENESSDocument CompletenessReportDocumentCompleteness
MISSING_DOCUMENTSMissing DocumentsReportMissingDocuments
CONTENT_BY_MILESTONEDocuments By MilestoneReportDocumentsByMilestone
CONTENT_ADVANCEDCustom Document ReportReportDocumentsAdvanced
INCOMPLETE_WORKFLOWS_PLATFORMIncomplete Workflow ReportIncompleteWorkflowReportData ²
PAYMENT_VOUCHERPayment Voucher(server-only)
PROTOCOL_DEVIATIONProtocol Deviation Report(server-only)
MONITOR_VISITMonitor Visit(server-only)

² In suredms-workflow-platform.

Management group (server-only)

Enum valueDisplay name
PROJECT_UPDATEProject Update Report
PROJECT_MILESTONESProject Milestones Report
PROJECT_ACTIVITIES_AND_TASKSProject Activities and Tasks Report
PROJECT_ACTION_ITEMSProject Action Items Report
STUDY_SUBJECT_PROCEDURE_PLANStudy Subject Procedure Plan Report
PAYMENTSPayments Report
ESSENTIAL_DOCUMENTSEssential Documents Report
PROTOCOL_DEVIATIONSProtocol Deviations Report
SERIOUS_ADVERSE_EVENTSSerious Adverse Events Report
SITE_STATUS_HISTORYSite Status History Report
STUDY_SUBJECTSStudy Subjects Report
STUDY_SUBJECT_STATUS_SUMMARYStudy Subject Status Summary Report
MONITOR_VISITSMonitor Visits Report
STUDY_SUBJECT_METRICS_VISITSStudy Subject Visit Metrics Report

Quality group

Enum valueDisplay nameServer-only
QUIZ_RESULTQuiz Result ReportNo
CONTROLLED_DOCUMENTSControlled Documents ReportYes
TRAINING_COURSESTraining Courses ReportYes
TRAINING_COURSE_STATUSTraining Course Status ReportYes
TRAININGTraining ReportYes
TRAINING_MATRIXTraining Matrix ReportYes
QUALITY_EVENTSQuality Events ReportYes

AbstractReportUserInterface

Located at: suredms-desktop-client/src/main/java/com/sureclinical/suredms/report/AbstractReportUserInterface.java

This is the abstract base class for all report UI panels. It extends AbstractProgressJob, which means it also acts as a background Job that runs in JobManager — report generation executes off the EDT.

Key responsibilities

  • Stores the ReportType and the ReportWizardContext.
  • Provides createReportContentPanel(), which builds the standard report panel layout: a report name text field at the top, report-specific content in the middle, and orientation/page format controls at the bottom.
  • Each subclass implements getReportContentPanel() (required) and getReportContentComponent() (optional) to supply the filter/selection controls specific to that report type.
  • Exposes run() (from AbstractProgressJob) which drives PDF generation via ReportGenerationHelper.

Panel layout

Reports use MigLayout with a three-section vertical layout:

SectionContent
NorthReport name text field (JTrimTextField)
CenterReport-specific content component (tree, filters, checkboxes)
South(optional) Orientation and page format controls (ReportOrientationPanel)

AbstractTreeReport

Most content reports extend AbstractTreeReport, which itself extends AbstractReportUserInterface. It provides:

  • A GadgetDocNav-based document tree for archive/folder/document selection.
  • A DocNavSelectionPanel for applying selection filters (e.g., content type filter, status filter).
  • Integration with DocNavViewMode to control tree display mode.

Subclasses override createSelectionFilterPanel() to add report-specific filter widgets (e.g., status checkboxes in ReportDocumentDiscrepancy).


Individual Report Implementations

ReportDocumentsAdvanced

Used for many CONTENT_BY_* reports and CONTENT_ADVANCED. Provides column selection, organization/person/milestone filter panels dynamically based on the ReportType. The most broadly reused implementation.

ReportDocumentDiscrepancy

Filters the document tree by discrepancy status (DS_OPEN / DS_CLOSED). Uses QualityService to fetch List<DocDiscrepancy> per document and applies open/closed checkbox filters.

ReportQualityCompliance

Reports on required content type coverage across selected archives. ReportMissingDocuments is a direct subclass that applies a missing-only filter on the same data.

ReportDocumentCompleteness

Extends ReportQualityCompliance to add document-level completeness status (whether all required metadata is filled).

ReportArchiveAudit

Shows archive-level audit events (create, update, lock, export). Data source is the audit trail for each selected archive.

ReportUserAuditTrail

Filters audit events by user identity. Builds a date range selector and optional username filter.

ReportUserAccessByArchive

Shows which users have access to which archives and at what role level. Uses team management data from EntityDataSource.

ReportBarcodeCoverSheetType

Generates a barcode cover sheet PDF. Works with BarcodeFactory to determine barcode format and BarcodeWriter to render the barcode image.

ReportOrganizationsByArchive / ReportPersonsByArchive

List all organizations or persons registered within each selected archive, including their roles.

ReportSystemUsersByInstance

System-wide user report across all archives. Shows user status, license type, and last login.


ReportGenerationHelper

Located at: suredms-desktop-client/src/main/java/com/sureclinical/suredms/report/ReportGenerationHelper.java

ReportGenerationHelper.generateReport() is the single entry point for all report generation. It:

  1. Calls ReportUtils.getReportObjectIds(reportWizardContext.getReportContext()) to determine the selected document or entity IDs.
  2. Builds a ReportContext via its builder, forwarding all filter, sorting, format, logo, watermark, page orientation, and pagination settings from ReportWizardContext.
  3. Calls ReportUtils.generateReport(reportContext, reportWizardContext) — this produces a Document (the PDF report stored in Nuxeo).
  4. Reloads the new report entity via DocumentUpdater.reloadEntityImmediately() and fires an endpoint data event.
  5. On the EDT, optionally navigates to the created report by calling ReportCallback.onReportCreated(report).

ReportContext — key settings

SettingControls
reportDefinitionJasperReports template definition
objectIdsIDs of the entities to include in the report
selectedColumnsColumn visibility for tabular reports
filterExpressionJNLP-style filter predicate
sortFieldsSort ordering
parametersArbitrary key-value parameters passed to JasperReports
pageOrientationPortrait or landscape
pageFormatA4, Letter, etc.
fitPageWidthScale content to page width
condensedCondensed row spacing
logoImage / watermarkImageOrganisation branding for reports
maxRowsMaximum result rows

Report Filtering Tree

Located at: suredms-desktop-client/src/main/java/com/sureclinical/suredms/report/filtering/

ClassPurpose
ReportFilteringTreeJTree subclass for visually selecting archives, folders, and documents to include in a report
ReportFilteringTreeNodeEditorIn-place tree node editor for selection checkboxes
ReportFilteringTreeNodeRendererCustom renderer for selected/unselected/partially-selected nodes
ReportFilteringUtilsUtility methods for extracting selected node IDs from the tree

Report Orientation Panel

ReportOrientationPanel is a small utility panel (also in suredms-desktop-client/report/) that provides:

  • Portrait / Landscape toggle buttons.
  • Page format selector (A4, Letter).
  • Optional condensed-layout checkbox.

It is embedded at the bottom of AbstractReportUserInterface.createReportContentPanel() for all non-trivial reports.


Signing and Workflow Reports

Two report types are implemented outside the main suredms-desktop-client report package:

ReportModuleClass
SIGNING_AUDIT_TRAILsuredms-desktop-client-signingReportSigningHistoryAuditTrail
SIGNATURE_VALIDATIONsuredms-desktop-client-signingReportSignatureValidation
WORKFLOWS_PLATFORMsuredms-workflow-platformWorkflowReportData
INCOMPLETE_WORKFLOWS_PLATFORMsuredms-workflow-platformIncompleteWorkflowReportData

These are discovered at runtime because ReportType stores the UI class name as a string and uses reflection to instantiate it.