Skip to main content

Overview

The REP (Reports) service generates PDF reports and documents for the HERCULES SGI system:
  • CSP Reports - Grant calls, applications, and project reports
  • ETI Reports - Ethics committee reports and certificates
  • PRC Reports - Scientific production reports
Base URL: /report

Authentication

All endpoints require JWT authentication with appropriate module permissions.

CSP Reports

Base path: /report/csp

Authorization Report for External Projects

curl -X GET "http://localhost:4280/report/csp/autorizacion-proyecto-externo/123?l=es" \
  -H "Authorization: Bearer {token}" \
  --output autorizacion.pdf
Generates a PDF authorization report for participation in external research projects.
idAutorizacion
long
required
Authorization identifier
l
string
Language code (e.g., es, en, gl, eu). Defaults to Spanish if not specified.
Required Permission: CSP-AUT-E, CSP-AUT-B, CSP-AUT-INV-C, CSP-AUT-INV-ER, CSP-AUT-INV-BR Response:
  • Content-Type: application/pdf
  • Body: PDF document binary
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 245823

Convocatoria Reports

Additional CSP report endpoints for convocatorias, solicitudes, and proyectos will be documented as they are implemented. The service architecture supports report generation for all CSP entities.

ETI Reports

Base path: /report/eti
ETI report endpoints for committee reports, actas, and evaluaciones will be available through this service. Reports include certificates, evaluation forms, and meeting minutes.

PRC Reports

Base path: /report/prc
PRC report endpoints for scientific production summaries and researcher CVs will be available through this service.

Report Features

Supported Output Formats

Currently, the service generates reports in:
  • PDF (primary format)
Future versions may support:
  • Excel (XLSX)
  • Word (DOCX)
  • CSV

Language Support

Reports support multiple languages through the l query parameter:
l
string
Language code:
  • es - Spanish (Castellano)
  • en - English
  • gl - Galician
  • eu - Basque
If no language is specified, Spanish is used as default.

Report Templates

Reports are generated using JasperReports templates with:
  • Dynamic data from the database
  • Internationalized text
  • Custom formatting and branding
  • Digital signatures (where applicable)

Usage Patterns

Downloading a Report

const response = await fetch(
  'http://localhost:4280/report/csp/autorizacion-proyecto-externo/123?l=en',
  {
    headers: {
      'Authorization': 'Bearer ' + token
    }
  }
);

const blob = await response.blob();
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'authorization-report.pdf';
a.click();

Opening Report in New Window

fetch('http://localhost:4280/report/csp/autorizacion-proyecto-externo/123', {
  headers: { 'Authorization': 'Bearer ' + token }
})
.then(response => response.blob())
.then(blob => {
  const url = window.URL.createObjectURL(blob);
  window.open(url, '_blank');
});

Error Responses

Report Not Found

status
integer
404
error
string
Not Found
message
string
The requested authorization does not exist

Insufficient Permissions

status
integer
403
error
string
Forbidden
message
string
User does not have permission to access this report

Report Generation Error

status
integer
500
error
string
Internal Server Error
message
string
Error generating report

Performance Considerations

Report generation is synchronous and may take several seconds for complex reports with large datasets. Consider:
  • Implementing client-side loading indicators
  • Setting appropriate timeout values
  • Caching frequently accessed reports
  • Using pagination for large datasets where applicable

Security

  • All report endpoints require authentication
  • Access control is enforced based on user permissions
  • Users can only generate reports for entities they have access to
  • Sensitive data is redacted based on user role

Build docs developers (and LLMs) love