Overview
Proyecto includes built-in PDF report generation for projects, tasks, and team members. Reports are generated using Django templates and can be customized to meet your specific needs.PDF reports use the
pdflistado action and render HTML templates from the templates/pdf/ directory. The rendered HTML is returned as JSON for client-side PDF generation.Report Types
Proyecto supports three types of reports:- Project Reports - List of all projects with leaders and team members
- Task Reports - List of all tasks with assignees
- Team Member Reports - List of all active team members
Generating Project Reports
Project reports display all active projects with their leaders and assigned team members.How to Generate
Implementation Details
Report Data Structure
Each project in the report includes:- pk: Project primary key (unique identifier)
- nombre_proyecto: Project name
- lider: Project leader’s name (from the related
encargadomodel) - encargados: List of team member names assigned to the project
Example Project Report Data
Example Project Report Data
Filtering and Sorting
- Filter: Only active projects (
status=True) are included - Sort: Projects are ordered by
nombre_proyectofirst, then bylider
Generating Task Reports
Task reports list all active tasks with their assigned team members.Implementation
Report Contents
Task reports include:- Task name (
nombre_tarea) - Assigned team member (
encargados) - Status (only active tasks with
status=True) - Registration date and time (from
ModeloBase)
The task report implementation filters all tasks but should also include
status=True filter for consistency with other reports.Task Report Workflow
Generating Team Member Reports
Team member reports list all active team members in the system.Implementation
Report Contents
- Team member name (
nombres) - Registration date (
fecha_registro) - Registration time (
hora_registro) - Status (only active members)
Use Cases
- Team directory: Maintain an up-to-date list of active team members
- Resource planning: View available team members for project assignment
- Auditing: Track when team members were added to the system
PDF Template Location
All PDF templates are stored in thetemplates/pdf/ directory:
Customizing Report Templates
You can customize the appearance and content of PDF reports by editing the HTML templates.Template Context
Each template receives adata dictionary with:
- empresa: Company name (e.g., “Michael”)
- nombre: Report title (e.g., “Proyectos”)
- ruta: URL path
- listado: Query result with report data
Customization Examples
Add Company Logo
Add Company Logo
Edit the template to include your company logo:
Add Report Metadata
Add Report Metadata
Include generation date and user information:
You’ll need to add these fields to the
data dictionary in the view.Customize Project Display
Customize Project Display
Format project data with additional styling:
Ajax PDF Generation
Project and team member reports also support Ajax-based generation for dynamic loading:Project Report Ajax
- Accepts a project
idparameter - Retrieves the specific project
- Renders the template
- Returns HTML as JSON for client-side processing
Team Member Report Ajax
The Ajax endpoints use
request.GET['id'] but the templates expect a list. You may need to adjust the template to handle single-record reports.Best Practices
Performance Optimization
Data Consistency
- Always filter by status: Ensure deleted records don’t appear in reports
- Use consistent ordering: Makes reports easier to compare over time
- Handle missing data: Check for null values in templates
Template Maintenance
Advanced Report Features
Adding Filters
You can add date range or status filters to report generation:Including Statistics
Add summary statistics to your reports:Multi-Project Reports
Generate reports for specific project sets:Error Handling
All report generation includes error handling:Next Steps
- Workflow Guide - Learn the complete project management workflow
- Authentication - Understand security and access control
- Customization - Advanced template and view customization