Skip to main content

Report Generator

The Report Generator module enables users to create, manage, and generate customized reports using SQL queries and report templates. Reports can be configured using system data sources or external database connections and exported in DOCX or HTML format.

Overview

The Report Generator provides the following capabilities:

  • Create custom reports
  • Configure report templates
  • Define SQL queries
  • Add report filters
  • Generate reports in DOCX or HTML format
  • Organize reports by project
  • Edit or delete reports (based on permissions)

Report Generator List

The Report Generator home screen displays all available reports grouped by project.

Available Actions

ActionDescription
Add ReportCreate a new report configuration
RefreshReload the report list
View InformationView query and filter configuration details
EditModify report configuration (if editable)
DeleteRemove report configuration (if deletable)
PDFGenerate and download the report

Conditions

  • Edit button is enabled only when Is Editable = True
  • Delete button is enabled only when Is Deletable = True
  • Reports are grouped by Project

Creating a Report

Step 1: Select Report Format

When creating a new report, select one of the following formats:

FormatDescription
DOCXMicrosoft Word template
HTMLHTML-based report template

Step 2: Configuration

Enter the following information:

FieldDescription
Report NameName of the report
ProjectProject to which the report belongs

Validation Rules

  • Report Name is mandatory
  • Project selection is mandatory

Step 3: Data Source Configuration

System Data Source

Enable System Data Source when report data should be retrieved from the MES application database.

No database configuration is required.

External Database

Disable System Data Source when data should be retrieved from an external database.

The following fields become mandatory:

FieldRequired
HostYes
PortYes
Database NameYes
User NameYes
PasswordYes
SchemaYes

Validation Rules

All database connection fields are required when System Data Source is disabled.


Step 4: SQL Query Configuration

Enter the SQL query used to retrieve report data.

Validation Rules

  • SQL Query is mandatory
  • Query must contain at least 15 characters

Example

SELECT *
FROM device_master
WHERE status = true;

Test Query

The Test Query option can be used to validate query execution before saving the report.


Step 5: Upload Template

Upload the report template based on the selected report format.

DOCX Format

Allowed file type:

.docx

HTML Format

Allowed file type:

.html

Validation Rules

  • Template upload is mandatory
  • Uploaded file type must match the selected report format

Step 6: Configure Filters

Filters allow users to provide input values during report generation.

Filter Fields

FieldDescription
AliasInternal filter name
Field NameDatabase field name
LabelDisplay label shown to users
TypeFilter input type

Supported Filter Types

  • Text
  • Number
  • Date
  • Dropdown

When Dropdown type is selected:

  • Dropdown Query becomes mandatory
  • Query should return dropdown values

Example:

SELECT division_name
FROM division_master
ORDER BY division_name;

Save Report

After completing all configurations:

  1. Verify report details.
  2. Validate SQL query.
  3. Upload the appropriate template.
  4. Configure required filters.
  5. Click Save Report.

The report will be available in the Report Generator list after successful creation.


Report Generation Flow

Notes

  • Reports can be grouped by Project.
  • Only editable reports can be modified.
  • Only deletable reports can be removed.
  • System reports may be protected from modification.
  • Templates must match the selected report format.
  • Filters are used during report execution to dynamically retrieve data.