Reports Module (Reference) provides comprehensive report generation capabilities including formatted documents, web data integration, and multi-format output support. The Reports Module enables::
- Text and PDF report generation
- Web API data integration
- Dynamic content with tags
- Multiple output formats
- Scheduled generation
- Real-time monitoring
In this page:
Module Components
Configuration Sections
Section | Path | Purpose |
---|---|---|
Forms | Reports → Forms | Report templates and formatting |
WebData | Reports → WebData | API integration and data exchange |
Forms Editor | Reports → Forms Editor | Visual report design |
WebData Editor | Reports → WebData Editor | Data structure editing |
Monitor | Reports → Monitor | Runtime status tracking |
Configuration Workflow
Step | Action | Location | Purpose |
---|---|---|---|
1 | Create Forms | Reports → Forms | Define report templates |
2 | Configure WebData | Reports → WebData | Setup API connections |
3 | Design Content | Reports → Forms Editor | Visual report layout |
4 | Map Data | Reports → WebData Editor | Configure data bindings |
Runtime Display
Windows WPF Clients
- ReportViewer Control - Native report rendering
- PdfViewer Control - PDF document display
Web HTML5 Clients
- PdfViewer Control - Browser-based PDF viewing
Control Examples
xml
<ReportViewer ReportName="ProductionReport" />
<PdfViewer Source="@Report.Form.DailyReport.SavedFileName" />
Report Namespace
Access report objects at runtime:
Common Properties
Property | Type | Description |
---|---|---|
@Report.Form.<Name> | ReportItem | Report form object |
@Report.WebData.<Name> | WebDataItem | WebData object |
@Report.Form.<Name>.Append | int | Append mode (0/1) |
@Report.Form.<Name>.Category | string | Report category |
@Report.Form.<Name>.SavedFileName | string | Output file path |
Runtime Methods
csharp
// Generate report
@Report.Form.ProductionReport.Generate();
// Save report
@Report.Form.ProductionReport.Save();
// Execute WebData request
await @Report.WebData.APIData.GetRequestAsync();
Report Generation
Manual Trigger
csharp
public void GenerateReport()
{
// Set report data
@Tag.ReportDate = DateTime.Today;
// Generate and save
@Report.Form.DailyReport.Generate();
@Report.Form.DailyReport.Save();
}
Scheduled Generation
Using SaveTrigger property:
csharp
// Configure trigger
@Report.Form.ShiftReport.SaveTrigger = "Tag.ShiftEnd";
// Trigger generation
@Tag.ShiftEnd = 1; // Triggers report
Output Formats
Format | Extension | Features | Use Case |
---|---|---|---|
Full formatting, professional | Distribution | ||
XPS | .xps | Windows native format | Internal use |
HTML | .html | Web-ready, hyperlinks | Online viewing |
Unicode | .txt | International characters | Multi-language |
ASCII | .txt | Plain text | Data export |
WebData Integration
API Configuration
csharp
// Configure endpoint
@Report.WebData.Weather.DefaultURL =
"https://api.weather.com/data";
// Set authentication
@Report.WebData.Weather.Headers["Authorization"] =
"Bearer {{Tag.APIToken}}";
Data Exchange
csharp
// GET request
string data = await @Report.WebData.Weather.GetRequestAsync();
// POST request
await @Report.WebData.Weather.PostRequestAsync();
Monitoring
Access Reports → Monitor during runtime:
- Generation status
- Error tracking
- File operations
- Server-side only
Monitor properties:
csharp
string status = @Report.Form.MyReport.LastStatus;
string error = @Report.Form.MyReport.LastStatusMessage;
Best Practices Checklist
- Test templates - Preview before production
- Validate data - Check tags before generation
- Handle errors - Monitor LastStatus
- Manage storage - Archive old reports
- Schedule wisely - Avoid peak times
- Secure APIs - Protect credentials
- Document reports - Clear descriptions
Troubleshooting
Report not generating:
- Check trigger conditions
- Verify data availability
- Review file permissions
- Monitor error messages
WebData fails:
- Verify API endpoint
- Check authentication
- Review network access
- Validate data format
Format issues:
- Match output to viewer
- Check font availability
- Review margins/spacing
- Test encoding
In this section...