Report Templates
Template-based document generation with dynamic data binding, conditional formatting, and automated layout management.
Create professional reports using predefined templates with dynamic data binding, conditional content, and automated formatting for consistent, branded document generation.
Features
- Template-based document generation
- Dynamic data binding and variable substitution
- Conditional content inclusion
- Multi-format output support (DOCX, PDF, HTML)
- Brand consistency and style management
Connector Options
The node uses reusable connector configuration that applies to all template operations:
| Parameter | Type | Required | Description |
|---|---|---|---|
templateDirectory | TEXT | No | Default directory containing template files |
outputDirectory | TEXT | No | Default output directory for generated reports |
brandAssets | TEXT | No | Directory containing logos and brand assets |
defaultFormat | TEXT | No | Default output format (default: docx) |
Methods
generateReport
Generate reports using templates with dynamic data and conditional content.
| Parameter | Type | Required | Description |
|---|---|---|---|
templateName | TEXT | Yes | Name or path of the template to use |
outputFileName | TEXT | Yes | Name for the generated report file |
data | Object | Yes | Data source for template variables |
options | Object | No | Report generation options and formatting |
outputFormat | TEXT | No | Output format: docx, pdf, html |
{
"templateName": "quarterly_report_template",
"outputFileName": "Q3_2024_Performance_Report",
"data": {
"report_period": "Q3 2024",
"company_name": "Acme Corporation",
"reporting_date": "2024-10-15",
"financial_data": {
"revenue": 2500000,
"profit": 450000,
"growth_rate": 15.3,
"expenses": 2050000
},
"kpis": [
{"metric": "Customer Acquisition", "value": 234, "change": "+18%"},
{"metric": "Customer Satisfaction", "value": 4.6, "change": "+0.2"},
{"metric": "Market Share", "value": 12.5, "change": "+1.8%"}
],
"departments": [
{"name": "Sales", "performance": "excellent", "budget_usage": 95},
{"name": "Marketing", "performance": "good", "budget_usage": 87}
]
},
"options": {
"includeSummary": true,
"includeCharts": true,
"showBudgetDetails": true,
"confidentialityLevel": "internal"
},
"outputFormat": "docx"
}Output:
success(Boolean) - Report generation success statusfilePath(String) - Path to the generated reportformat(String) - Output format of the generated reportpageCount(Number) - Number of pages in the reportstatistics(Object) - Generation statistics and metadata
batchReporting
Generate multiple reports using the same template with different data sets.
| Parameter | Type | Required | Description |
|---|---|---|---|
templateName | TEXT | Yes | Template to use for all reports |
reports | Array | Yes | Array of report configurations |
outputDirectory | TEXT | No | Directory for generated reports |
sharedData | Object | No | Common data used across all reports |
{
"templateName": "client_report_template",
"reports": [
{
"outputFileName": "client_report_acme.docx",
"data": {
"client_name": "Acme Corp",
"account_manager": "John Smith",
"metrics": {"satisfaction": 4.8, "retention": 95}
}
},
{
"outputFileName": "client_report_techco.docx",
"data": {
"client_name": "TechCo Inc",
"account_manager": "Jane Doe",
"metrics": {"satisfaction": 4.5, "retention": 89}
}
}
],
"sharedData": {
"reporting_period": "Q3 2024",
"company_logo": "/sandbox/assets/company_logo.png",
"contact_info": "support@company.com"
}
}createTemplate
Create new report templates with structure definitions and styling.
| Parameter | Type | Required | Description |
|---|---|---|---|
templateName | TEXT | Yes | Name for the new template |
structure | Object | Yes | Template structure and layout definition |
styles | Object | No | Custom styling and formatting rules |
variables | Object | No | Variable definitions and validation rules |
{
"templateName": "project_status_report",
"structure": {
"sections": [
{
"name": "header",
"type": "header",
"content": [
{"type": "logo", "source": "{{company_logo}}"},
{"type": "title", "text": "{{report_title}}"},
{"type": "date", "text": "{{report_date}}"}
]
},
{
"name": "executive_summary",
"type": "section",
"title": "Executive Summary",
"content": [
{"type": "paragraph", "text": "{{executive_summary}}"}
]
},
{
"name": "project_details",
"type": "section",
"title": "Project Details",
"content": [
{"type": "table", "data": "{{project_data}}"},
{"type": "chart", "source": "{{status_chart}}"}
]
}
]
},
"variables": {
"report_title": {"type": "string", "required": true},
"report_date": {"type": "date", "default": "{{current_date}}"},
"project_data": {"type": "array", "required": true},
"executive_summary": {"type": "string", "maxLength": 500}
}
}Template Structure
Section Types
| Section Type | Description | Usage |
|---|---|---|
header | Document header with branding | Company logo, title, date |
footer | Document footer information | Page numbers, contact info |
title_page | Dedicated title/cover page | Report title, author, date |
table_of_contents | Automatically generated TOC | Document navigation |
section | Content sections with headings | Main report content |
appendix | Supporting materials | Additional data, references |
Content Elements
{
"contentElements": {
"text": {
"type": "paragraph",
"text": "{{variable_name}}",
"formatting": {"bold": true, "color": "#333333"}
},
"table": {
"type": "table",
"data": "{{table_data}}",
"headers": ["Column 1", "Column 2"],
"formatting": {
"style": "TableGrid",
"alternatingRows": true
}
},
"chart": {
"type": "chart",
"source": "{{chart_data}}",
"chartType": "column",
"title": "Performance Metrics"
},
"image": {
"type": "image",
"source": "{{image_path}}",
"width": 400,
"alignment": "center"
},
"list": {
"type": "list",
"items": "{{list_items}}",
"listType": "bulleted",
"style": "compact"
}
}
}Dynamic Content
Variable Substitution
Replace placeholders with dynamic data:
{
"variables": {
"company_name": "Acme Corporation",
"report_date": "2024-10-15",
"total_revenue": 2500000,
"formatted_revenue": "{{currency(total_revenue)}}",
"growth_percentage": "{{percentage(growth_rate)}}",
"current_quarter": "{{quarter(report_date)}}"
},
"templateContent": [
{
"type": "paragraph",
"text": "{{company_name}} achieved {{formatted_revenue}} in revenue for {{current_quarter}}, representing {{growth_percentage}} growth."
}
]
}Conditional Content
Include or exclude content based on data conditions:
{
"conditionalContent": [
{
"condition": "revenue > 2000000",
"content": [
{
"type": "paragraph",
"text": "Congratulations on exceeding the revenue target!",
"style": "SuccessHighlight"
}
]
},
{
"condition": "show_budget_details == true",
"content": [
{
"type": "section",
"title": "Budget Analysis",
"content": "{{budget_section}}"
}
]
},
{
"condition": "confidentiality_level == 'internal'",
"content": [
{
"type": "watermark",
"text": "INTERNAL USE ONLY"
}
]
}
]
}Data Transformation
Apply formatting functions to raw data:
{
"dataTransformations": {
"currency": {
"function": "formatCurrency",
"params": {"symbol": "$", "decimals": 0}
},
"percentage": {
"function": "formatPercentage",
"params": {"decimals": 1}
},
"date": {
"function": "formatDate",
"params": {"format": "MMMM DD, YYYY"}
},
"number": {
"function": "formatNumber",
"params": {"thousands": ",", "decimals": 2}
}
}
}Chart Integration
Chart Types and Data
Generate charts from data and embed in reports:
{
"chartDefinitions": {
"revenue_trend": {
"type": "line",
"data": "{{monthly_revenue}}",
"xAxis": "month",
"yAxis": "revenue",
"title": "Revenue Trend Over Time",
"formatting": {
"width": 500,
"height": 300,
"colors": ["#4472C4", "#E16F24"]
}
},
"department_performance": {
"type": "column",
"data": "{{department_data}}",
"xAxis": "department",
"yAxis": "performance_score",
"title": "Department Performance Comparison"
},
"market_share": {
"type": "pie",
"data": "{{market_data}}",
"label": "company",
"value": "market_share",
"title": "Market Share Distribution"
}
}
}Chart Styling
{
"chartStyles": {
"corporate": {
"colors": ["#1F497D", "#4F81BD", "#9CBEDF", "#B4C6E7"],
"fonts": {"title": "Arial Bold 14pt", "axis": "Arial 10pt"},
"background": "#FFFFFF",
"gridlines": "#E0E0E0"
},
"professional": {
"colors": ["#2E75B6", "#5B9BD5", "#A5C6EA", "#C5DBEF"],
"effects": {"shadow": true, "gradient": false},
"borders": {"width": 1, "color": "#CCCCCC"}
}
}
}Brand Management
Style Definitions
Maintain consistent branding across all reports:
{
"brandStyles": {
"colors": {
"primary": "#1F497D",
"secondary": "#4F81BD",
"accent": "#F79646",
"text": "#000000",
"background": "#FFFFFF"
},
"fonts": {
"heading": {"family": "Arial", "weight": "bold"},
"body": {"family": "Arial", "weight": "normal"},
"caption": {"family": "Arial", "weight": "italic", "size": 9}
},
"layouts": {
"margins": {"top": 1, "bottom": 1, "left": 1.25, "right": 1.25},
"spacing": {"paragraph": 6, "section": 18},
"pageSize": "A4",
"orientation": "portrait"
}
}
}Brand Assets
Integrate logos and branded elements:
{
"brandAssets": {
"logo": {
"primary": "/sandbox/assets/logo_primary.png",
"secondary": "/sandbox/assets/logo_secondary.png",
"monochrome": "/sandbox/assets/logo_mono.png"
},
"backgrounds": {
"letterhead": "/sandbox/assets/letterhead_bg.png",
"footer": "/sandbox/assets/footer_pattern.png"
},
"usage": {
"logo_position": "header_right",
"logo_size": {"width": 120, "height": 60},
"watermark": {"opacity": 0.1, "position": "center"}
}
}
}Multi-Format Output
Format-Specific Configuration
Configure output for different formats:
{
"formatConfigurations": {
"docx": {
"compatibility": "word2016",
"features": ["tables", "charts", "images", "headers_footers"],
"optimization": "size"
},
"pdf": {
"quality": "high",
"compression": true,
"security": {
"password_protection": false,
"printing": "allowed",
"copying": "allowed"
},
"accessibility": true
},
"html": {
"css": "embedded",
"responsive": true,
"compatibility": "modern",
"includes": ["charts_as_svg", "responsive_tables"]
}
}
}Format-Specific Elements
{
"formatSpecificContent": {
"docx_only": [
{
"type": "pageBreak",
"condition": "format == 'docx'"
}
],
"web_only": [
{
"type": "interactive_chart",
"condition": "format == 'html'",
"source": "{{chart_data}}"
}
],
"print_optimized": [
{
"type": "high_resolution_image",
"condition": "format == 'pdf'",
"dpi": 300
}
]
}
}Automation and Scheduling
Automated Report Generation
Configure automatic report generation:
{
"automationConfig": {
"schedule": {
"frequency": "monthly",
"day": 1,
"time": "09:00",
"timezone": "UTC"
},
"dataSource": {
"type": "database",
"connection": "{{db_connection}}",
"query": "SELECT * FROM monthly_metrics WHERE period = '{{current_month}}'"
},
"recipients": [
{"email": "ceo@company.com", "format": "pdf"},
{"email": "operations@company.com", "format": "docx"}
],
"notifications": {
"onSuccess": true,
"onFailure": true,
"includePreview": true
}
}
}Data Pipeline Integration
Connect with data sources for real-time reporting:
{
"dataPipeline": {
"sources": [
{
"name": "sales_data",
"type": "api",
"endpoint": "https://api.company.com/sales/metrics",
"authentication": "bearer_token",
"refresh_interval": 3600
},
{
"name": "financial_data",
"type": "file",
"path": "/sandbox/data/financial_export.csv",
"format": "csv",
"columns": ["date", "revenue", "expenses", "profit"]
}
],
"transformations": [
{
"source": "sales_data",
"operations": ["aggregate_by_month", "calculate_growth_rate"]
}
]
}
}Error Handling
Template Validation
Validate templates before use:
{
"templateValidation": {
"structure": {
"required_sections": ["header", "content"],
"variable_references": "validate_all",
"conditional_logic": "check_syntax"
},
"data": {
"required_variables": ["report_title", "report_date"],
"type_checking": true,
"range_validation": true
},
"assets": {
"check_file_existence": true,
"validate_image_formats": true,
"verify_chart_data": true
}
}
}Error Response Format
{
"success": false,
"error": {
"type": "TEMPLATE_VARIABLE_MISSING",
"message": "Required variable 'revenue_data' not provided for template 'quarterly_report'",
"template": "quarterly_report_template.docx",
"section": "financial_summary",
"missingVariables": ["revenue_data", "expense_breakdown"],
"suggestions": [
"Provide revenue_data array with monthly values",
"Include expense_breakdown object with category totals",
"Check template documentation for required data structure"
]
}
}Usage Examples
Executive Dashboard Report
{
"templateName": "executive_dashboard",
"outputFileName": "executive_dashboard_october_2024",
"data": {
"company": "Tech Solutions Inc",
"period": "October 2024",
"kpis": {
"revenue": 3200000,
"growth": 22.5,
"customers": 1847,
"satisfaction": 4.7
},
"departments": [
{"name": "Engineering", "headcount": 45, "budget_usage": 92},
{"name": "Sales", "headcount": 23, "budget_usage": 88},
{"name": "Marketing", "headcount": 12, "budget_usage": 95}
],
"projects": [
{"name": "Platform Upgrade", "progress": 85, "status": "on_track"},
{"name": "Mobile App", "progress": 60, "status": "at_risk"}
]
},
"options": {
"includeProjectDetails": true,
"showBudgetAnalysis": true,
"confidentialityLevel": "executive"
}
}Client Performance Report
{
"templateName": "client_performance_report",
"outputFileName": "client_report_q4_2024",
"data": {
"client": {
"name": "Global Manufacturing Corp",
"account_manager": "Sarah Johnson",
"contract_value": 850000,
"contract_start": "2024-01-15"
},
"services": [
{"service": "IT Support", "utilization": 95, "satisfaction": 4.8},
{"service": "Cloud Migration", "utilization": 78, "satisfaction": 4.6},
{"service": "Security Audit", "utilization": 100, "satisfaction": 4.9}
],
"metrics": {
"uptime": 99.7,
"response_time": 12,
"issue_resolution": 4.2,
"cost_savings": 125000
},
"recommendations": [
"Expand cloud migration scope",
"Implement advanced monitoring",
"Schedule quarterly security reviews"
]
}
}Integration Patterns
With Data Analysis Tools
Automatically generate reports from analysis results with embedded charts and statistical summaries.
With File System Tools
Organize generated reports in structured directories with automatic archiving and version control.
With Web Tools
Create reports from web-scraped competitive intelligence or market research data.
Best Practices
Template Design
- Create modular, reusable template components
- Use consistent naming conventions for variables
- Document template requirements and data structures
- Test templates with various data scenarios
Data Management
- Validate data before report generation
- Implement data transformation pipelines
- Cache frequently used data sources
- Monitor data quality and completeness
Brand Consistency
- Maintain centralized brand asset libraries
- Use consistent color schemes and typography
- Implement template approval workflows
- Regular brand compliance reviews
Performance
- Optimize template complexity for processing speed
- Use efficient chart generation libraries
- Implement caching for repeated operations
- Monitor memory usage for large datasets
Getting Started
- Design report structure and identify data requirements
- Create template with placeholder variables and sections
- Define brand styles and formatting rules
- Test template with sample data
- Configure output formats and automation
- Implement error handling and validation