ReportWizard User Documentation (أداة إنشاء تقرير)
Complete Guide to Report Creation and Management
Introduction
The ReportWizard (أداة إنشاء تقرير) is a powerful report generation tool within Nama ERP that enables users to create professional, data-rich reports without writing code. It generates JasperReports-based outputs with extensive customization options for data extraction, formatting, and presentation.
Entity Information
- Entity Type: ReportWizard
- Arabic Name: أداة إنشاء تقرير
- English Name: Report Wizard
- Entity Classification: Master File
- Database Table: ReportWizard
Entity Structure Overview
The ReportWizard entity contains 32 detail collections for comprehensive report configuration:
Collection | Arabic Name | English Name | Purpose |
---|---|---|---|
fields | الحقول | Fields | Report field definitions and formatting |
parameters | المدخلات | Parameters | User input parameters for report filtering |
group1Lines - group5Lines | سطور المجموعة 1-5 | Group 1-5 Lines | 5-level hierarchical grouping configuration |
crosstabColumns | الأعمدة | Columns | Crosstab horizontal dimension fields |
crosstabRows | الصفوف | Rows | Crosstab vertical dimension fields |
crosstabMeasures | المعادلات | Measures | Crosstab aggregated value fields |
dataSource1FilterLines - dataSource5FilterLines | سطور الفلترة لمصدر البيانات 1-5 | Data Source 1-5 Filter Lines | Multi-source data filtering |
conditionalStyleLines1 - conditionalStyleLines5 | جدول التنسيق الشرطي 1-5 | Conditional Style 1-5 Lines | Dynamic formatting rules |
securityConstraints | Security Constraints | Security Constraints | Row-level security configuration |
includeTablesByParameters | تضمين الجداول بشرط من خلال مدخلات | Include Tables By Parameters | Dynamic table inclusion |
Key Benefits
- No SQL Required: Select entities and fields through intuitive interface
- Multi-Language Support: Full Arabic and English support throughout
- Real-Time Preview: See changes as you make them
- Reusable Templates: Save and copy report configurations
- Enterprise Security: Built-in row and field-level security
- Multiple Output Formats: PDF, Excel, HTML, and direct printing
Report Types Supported
- Standard Lists: Simple tabular reports with filtering and sorting
- Grouped Reports: Multi-level hierarchical reports with subtotals
- Crosstab/Pivot Reports: Multi-dimensional analysis with row and column grouping
- Master-Detail Reports: Parent-child relationships with nested data
- Statistical Reports: Aggregations, calculations, and summaries
- Form Letters: Document generation with background templates
- Dashboard Reports: KPI and metric displays
Getting Started
Creating a New Report
Access the ReportWizard
- Navigate to Basic → Reports → Report Wizard
- Click "New" to create a new report
- Or copy an existing report using "Copy Configuration From Report"
Basic Configuration
- Code: Unique identifier for the report (e.g., "SALES_MONTHLY_001")
- Name: Display name in report lists
- Report Group: Category for organizing reports
- Arabic Title: Report title in Arabic
- English Title: Report title in English
Layout Method Selection
- Standard: Traditional columnar layout
- Crosstab: Pivot table format
- Custom: Advanced layouts with manual configuration
Page Setup
Page Format Options
- A4 (210 × 297 mm): Standard international size
- Letter (8.5 × 11 inches): North American standard
- Legal (8.5 × 14 inches): Extended length documents
- Custom: Define specific width and height in millimeters
Page Orientation
- Portrait: Vertical orientation (taller than wide)
- Landscape: Horizontal orientation (wider than tall)
Margin Configuration
- Top Margin: Space above content
- Bottom Margin: Space below content
- Left Margin: Space on left side
- Right Margin: Space on right side
- Gutter: Additional binding margin
Band Heights
Bands are sections of the report that appear in specific locations:
- Title Band Height: One-time header at report start (default: 50px)
- Page Header Band Height: Repeated at top of each page (default: 30px)
- Column Header Band Height: Table headers (default: 30px)
- Detail Band Height: Data rows (default: 20px)
- Page Footer Band Height: Repeated at bottom of each page (default: 30px)
- Last Page Footer Band Height: Special footer for last page only
- Summary Band Height: Report totals section (default: 30px)
Data Source Configuration
Main Table Selection
The main table is the primary data source for your report:
Table Type Selection
- Entity: Business objects (Customer, Invoice, Product, etc.)
- SQL View: Pre-defined database views
- Custom Query: Write your own SQL (advanced users)
Entity Browser
- Search by entity name or code
- Filter by module (Accounting, CRM, HR, etc.)
- View entity descriptions and field counts
- Check POS compatibility if needed
Union Tables (Combining Multiple Sources)
Union tables allow you to combine data from multiple similar entities that serve different purposes or come from different systems into a single unified report.
When to Use Union Tables
- Net Calculations: Combine positive and negative transactions (e.g., Sales Invoices + Sales Returns for net sales)
- Multi-Source Documents: Merge similar documents from different systems (e.g., SalesInvoice + NamaPOSSalesInvoice)
- Payment Consolidation: Combine different payment types (e.g., ReceiptVoucher + BankTransfers)
- Cross-System Reporting: Unite data from multiple business processes into one view
- Document Type Aggregation: Combine various document types that share similar business meaning
How Union Tables Work
- Field Mapping: The system maps corresponding fields between tables
- Column Flexibility: If column names differ, you can specify which column from each table maps to the report field
- Union Handling: Apply transformations to differentiate or modify data from each source
Configuration Steps
- Add union tables in the "Union Tables" section
- Map fields between tables (automatic for matching names, manureal for different names)
- Configure "Union Handling" expressions to transform data per source
- Test the combined result set
Example 1: Net Sales Report
Main Table: SalesInvoice
Union Table: SalesReturn
Union Handling:
- SalesInvoice: Keep quantities positive
- SalesReturn: Make quantities negative
Result: Net sales with returns automatically deducted
Example 2: Unified Sales from Multiple Systems
Main Table: SalesInvoice (Regular sales)
Union Table: NamaPOSSalesInvoice (POS terminal sales)
Result: Complete sales picture from all channels
Example 3: Consolidated Cash Flow
Main Table: ReceiptVoucher (Cash receipts)
Union Table 1: BankTransfers (Bank receipts)
Union Table 2: PaymentVoucher (Cash payments - negative)
Result: Complete cash flow report
Dynamic Table Inclusion
The "Include Tables By Parameters" feature enables runtime table selection:
Configuration
- Define up to 10 table slots per parameter line
- Create parameter for user selection
- Tables are included based on parameter value
Use Cases
- Multi-Company Reports: User selects which companies to include
- Period Selection: Include specific month/year tables
- Regional Reports: Dynamically include region-specific tables
- Product Categories: Include only selected category tables
Example Setup
Parameter: "Select Regions to Include" Table 1: NorthRegionSales (included if "North" selected) Table 2: SouthRegionSales (included if "South" selected) Table 3: EastRegionSales (included if "East" selected)
Multiple Data Sources
The wizard supports up to 5 additional data sources beyond the main table:
Data Source Configuration
- Data Source 1-5: Select additional entities or queries
- Linking Configuration: Define relationships between sources
- Filter Configuration: Add WHERE conditions per source
Linking Options
- Inner Join: Include only matching records
- Left Join: Include all main records, matching additional when available
- Subquery: Use data source as a subquery for calculations
- Independent: No relationship (Cartesian product - use carefully)
Use as Subquery Option
When enabled, the data source becomes a correlated subquery:
- Useful for calculations (e.g., "Total orders per customer")
- Aggregations independent of main query grouping
- Performance optimization for complex calculations
Show All Values Option
Controls outer join behavior:
- Enabled: Left outer join (show all main records)
- Disabled: Inner join (only matching records)
Field Management
Field Types
1. Database Fields
Direct columns from the selected entity:
- Simple Fields: Text, numbers, dates
- Reference Fields: Links to other entities (shown as codes or names)
- System Fields: Created date, modified date, created by, etc.
2. Custom Expression Fields
User-defined calculations:
- SQL Expressions: Database-level calculations
- Jasper Expressions: Report-engine calculations
- Formula Examples:
amount * 1.15
(Add 15% tax)CONCAT(firstName, ' ', lastName)
(Combine names)DATEDIFF(endDate, startDate)
(Calculate days between)
3. Alternative Fields
System-provided alternatives for complex data:
- Reference display options (Code, Name, Full Description)
- Translated values
- Formatted representations
Field Configuration Options
The fields
collection (الحقول) contains comprehensive field configuration with 50+ properties per field:
Field Collection Technical Structure
Table: ReportWizardFieldLine
Join Column: reportWizard_id
Key Properties Include:
- Basic Configuration:
fieldId
,arabicTitle
,englishTitle
,type
,namaFieldType
- Display Settings:
fieldWidth
,widthSize
,hidden
,displayFieldAs
- Formatting:
patternType
,customPattern
,barcodeType
- Aggregation:
sqlAggregationType
,totalPosition
,showRunningTotalInsteadOfValue
- Group Totals:
showTotalInGroup1Section
throughshowTotalInGroup5Section
- References:
displayReferenceAs
,doNotAddLinkToReferences
,referenceOrderBy
- Custom Logic:
customSqlExpression
,customJasperExpression
,unionHandling
- Styling:
style
,conditionalStyleGrid
,summaryStyle
Display Properties
Field Width
- Fixed Width: Specify exact width in pixels
- Grid Size: Responsive sizing (Small, Medium, Large, XLarge)
- Auto: System determines based on content
Titles and Labels
- Arabic Title: Label shown in Arabic reports
- English Title: Label shown in English reports
- Merged Titles: Combined headers for grouped columns
- User Alias: Alternative internal name for expressions
Visibility Control
- Hidden: Field is included in data but not displayed
- Display Attachment as Image: Show file attachments as embedded images
- Do Not Add Link to References: Disable drill-down on reference fields
Formatting Options
Pattern Types
- Number: Decimal places, thousand separators, negative format
- Currency: Currency symbol, decimal places
- Date: Various date formats (dd/MM/yyyy, MMM dd yyyy, etc.)
- Time: Time formats (HH:mm:ss, hh:mm AM/PM)
- Percentage: Show as percentage with specified decimals
- Custom: User-defined format patterns
Custom Patterns
#,##0.00
: Number with 2 decimalsdd/MM/yyyy
: Date format#,##0.00;(#,##0.00)
: Positive;Negative format00000
: Leading zeros (e.g., 00123)
Display Options
- Display Field As: Text, Number, Barcode, QR Code
- Barcode Type: Code128, Code39, QR, DataMatrix, EAN13
- Currency Field: Link to currency field for multi-currency reports
- Show Zero as Empty: Hide zero values
Aggregation Functions
SQL Aggregation Types
- SUM: Total of all values
- COUNT: Number of records
- COUNT DISTINCT: Number of unique values
- AVG: Average value
- MIN: Minimum value
- MAX: Maximum value
- GROUP_CONCAT: Concatenate text values
Total Positions
- None: No totals
- Summary Only: Grand total at report end
- Group Footers: Subtotals per group
- Both: Group subtotals and grand total
Running Totals
- Show Running Total Instead of Value: Display cumulative sum
- Reset at Group: Restart running total at group boundaries
Advanced Field Features
Hyperlink Configuration
- Create clickable links in reports
- Link to other reports or external URLs
- Pass parameters through links
- Example:
"http://erp/customer/" + $F{customerId}
Conditional Styling
- Apply different styles based on values
- Highlight negative numbers
- Color-code status fields
- Bold important values
Reference Display Options
- Code Only: Show reference code
- Name Only: Show reference name
- Code and Name: Show both
- Full Details: Complete reference information
Grouping and Organization
Understanding Groups
Groups organize data hierarchically, creating sections with headers, footers, and subtotals. The ReportWizard supports 5 levels of grouping.
Group Hierarchy Example
Country (Group 1)
├── Region (Group 2)
│ ├── City (Group 3)
│ │ ├── District (Group 4)
│ │ │ ├── Store (Group 5)
│ │ │ │ └── Detail Records
│ │ │ └── Store Totals
│ │ └── District Totals
│ └── City Totals
└── Region Totals
Country Totals
Configuring Each Group Level
Group Fields
- Select one or more fields to group by
- Order matters for hierarchy
- Can group by expressions
Group Headers
- Show Group Header: Enable/disable header section
- Arabic Title: Header label in Arabic
- English Title: Header label in English
- Custom Header Expression: Dynamic header content
Group Footers
- Footer Band Height: Space for group totals
- Totals Arabic Title: Label for subtotals in Arabic
- Totals English Title: Label for subtotals in English
- Custom Footer Expression: Calculated footer content
Group Behavior Options
Page Control
- Start New Page: Begin new page when group changes
- Reprint Header on Each Page: Repeat group header after page breaks
- Reset Page Number: Restart page numbering for each group
Visual Specifications
- Height: Group band height in pixels
- Font Size: Text size for group headers/footers
- Foreground Color: Text color
- Background Color: Band background color
Custom Group Expressions
Groups support custom expressions for complex calculations:
Header Custom Expressions
- Display calculated values in group headers
- Show group statistics
- Conditional content based on group values
Footer Custom Expressions
- Complex subtotal calculations
- Percentage of total calculations
- Group-level aggregations
Expression Lines
Add multiple expression fields to headers/footers:
- Define expression
- Set position and formatting
- Configure visibility conditions
Group Totals Configuration
For each field with aggregation:
- Show Total in Group 1 Section: None/Header/Footer/Both
- Show Total in Group 2 Section: None/Header/Footer/Both
- (Continues for all 5 group levels)
Sorting and Filtering
Sorting Methods
The sortMethod
field (طريقة الترتيب) determines how data is sorted in the report:
1. Sort Based On Sort Fields (ترتيب محدد من خلال حقول الترتيب)
- Enum Value:
SortBasedOnSortFields
- Sort Parameters Count: Number of sort fields (1-10)
- Ascending/Descending: Sort direction per field
- Performance: Most efficient for large datasets
- Configuration: Uses
sortFields
collection (حقول الترتيب) to define sort criteria
2. Sort Based On Report Parameter (ترتيب من خلال مدخلات يقوم باختيارها المستخدم)
- Enum Value:
SortBasedOnReportParameter
- Jasper Sort Fields: Uses
jasperSortFieldsLines
collection - Use When: User-selectable sorting or sorting by calculated fields
- Runtime Control: Users can modify sort order during report execution
3. Multi-Level Sorting
Configure primary, secondary, tertiary sort fields:
- Primary: Main sort criterion
- Secondary: Sort within primary groups
- Tertiary: Final sort level
Filtering Options
Static WHERE Conditions
Permanent filters always applied:
-- Examples:
status = 'Active'
amount > 1000
date >= '2024-01-01'
region IN ('North', 'South')
Static HAVING Conditions
Filters applied after grouping:
-- Examples:
SUM(amount) > 10000
COUNT(*) >= 5
AVG(score) > 75
Dynamic Parameter Filtering
Create user-selectable filters:
- Define parameter
- Add to WHERE clause
- User selects value at runtime
Where Lines Configuration
Build complex filter conditions:
- Add multiple WHERE line conditions
- Combine with AND/OR logic
- Support for subqueries and EXISTS clauses
Print When Expressions
Control when elements appear:
-- Examples:
$F{amount} > 0 -- Only show if amount is positive
$V{PAGE_NUMBER} == 1 -- Only on first page
$P{showDetails} == true -- Based on parameter
Parameters and User Input
Parameter Types
1. Simple Parameters
- Text: Free text input
- Number: Numeric values with validation
- Date: Date picker with calendar
- Boolean: Yes/No checkbox
2. Selection Parameters
- Single Select: Dropdown list
- Multi-Select: Multiple choice checkboxes
- Entity Reference: Select from entity list
3. Range Parameters
- Date Range: From and To dates
- Number Range: Minimum and Maximum values
- Custom Range: User-defined range logic
Parameter Configuration
The parameters
collection (المدخلات) provides extensive parameter configuration options:
Parameter Collection Technical Structure
Table: ReportWizardParameterLine
Join Column: reportWizard_id
Key Properties Include:
- Basic Setup:
fieldId
,arabicTitle
,englishTitle
,required
,requiredGroup
- Data Types:
paramType
,parameterType
,namaFieldType
- Default Values:
defaultValue
,defaultValueDate
,defaultValueDateTime
,refDefaultValue
- Range Support:
defaultValueWithBetween
,defaultValueDateWithBetween
,refDefaultValueWithBetween
- Reference Parameters:
refEntityType
,filter
,filterType
,referenceOrderBy
- Layout Control:
layout
,showInsideReport
,hidden
- Cascading Logic:
sourceParameter
,sourceProperty
,allowedValues
- Custom Expressions:
customSqlExpression
,customJasperExpression
Basic Settings
- Field ID: Parameter reference name
- Arabic Title: Label in Arabic interface
- English Title: Label in English interface
- Default Value: Pre-filled value
- Required: Must be filled before running
Layout Configuration
Parameters Position (
parametersPosition
): Available values from the system:- FirstPageHeaderOnly: Show only on first page header
- AllPagesHeader: Repeat on every page header
- AllPagesFooter: Show on every page footer
- None: Don't display parameters in report
- GroupHeader: Display in group headers
- GroupFooter: Display in group footers
- LastPageFooter: Show only on last page footer
- Summary: Display in summary section
Number of Parameters in Row (
numberOfParametersInRow
): Columns per row (1-4)Parameters Grid Specs:
- Height, font size, colors
- Alignment and spacing
- Border and background
Advanced Parameter Features
Cascading Parameters
Parameters that depend on other parameters:
- Country selection filters available cities
- Department selection filters employees
- Year selection determines available months
Hidden Parameters
System-calculated values:
- Current user
- Current date/time
- Organization unit
- Security context
Parameter Validation
- Required field validation
- Format validation (email, phone, etc.)
- Range validation
- Custom validation expressions
Using Groups as Parameters
Enable users to select grouping at runtime:
- Use Groups as Parameter: Enable option
- Configure: Which group levels are selectable
- Runtime: User chooses grouping structure
Crosstab Reports
Understanding Crosstabs
Crosstabs (pivot tables) transform row-based data into a matrix format, ideal for comparative analysis across multiple dimensions.
Basic Structure
Column Dimension →
Jan Feb Mar Total
Row North 100 150 125 375
Dimension South 200 175 225 600
↓ East 150 160 180 490
Total 450 485 530 1465
Crosstab Configuration
Row Fields (Vertical Dimension)
- Select Row Fields: Choose fields for vertical grouping
- Row Order: Determines hierarchy
- Row Parameters: Allow runtime selection
- Select as Parameter: Enable user selection
- Parameters Count: Max selectable fields
- Title Prefix: Parameter label prefix
Column Fields (Horizontal Dimension)
- Select Column Fields: Choose fields for horizontal grouping
- Column Order: Determines hierarchy
- Column Parameters: Allow runtime selection
- Select as Parameter: Enable user selection
- Parameters Count: Max selectable fields
- Title Prefix: Parameter label prefix
Measures (Values)
- Select Measure Fields: Values to aggregate
- Aggregation Type: SUM, COUNT, AVG, MIN, MAX
- Display Format: Number format, decimals
- Multiple Measures: Support for multiple value fields
Crosstab Display Options
Cell Configuration
- Cell Width: Width in pixels
- Cell Height: Height in pixels
- Ignore Width: Auto-size based on content
- Display Measures Vertically: Stack multiple measures
Visual Settings
- Show Grid: Display cell borders
- Use White Grid: Light border color
- Color Scheme: Apply to crosstab structure
Advanced Crosstab Features
Dynamic Dimensions
Allow users to select dimensions at runtime:
- Enable parameter selection
- Provide dimension choices
- Report adapts to selection
Calculated Measures
Create derived values:
- Percentages of totals
- Growth calculations
- Ratios and indices
- Custom formulas
Drill-Down Support
Click on cells to see details:
- Link to detail reports
- Pass cell context as parameters
- Maintain navigation context
Visual Formatting
Color Schemes
Predefined Schemes
The colorScheme
field provides extensive color options. Key schemes include:
Professional/Business Colors:
- Aliceblue: Light blue professional theme
- Ghostwhite: Clean white-based theme
- Lightgray: Professional gray theme
- Silver: Metallic corporate theme
- Gainsboro: Subtle gray professional
Vibrant Colors:
- Blue: Classic blue scheme
- Green: Nature-inspired green
- Red: Bold red theme
- Purple: Rich purple scheme
- Orange: Energetic orange theme
Neutral/Print-Friendly:
- White: Clean white background
- Black: High contrast black theme
- Gray: Standard gray scheme
Complete Color List (100+ Options)
The system supports over 100 predefined colors including: Aliceblue, Antiquewhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, Blanchedalmond, Blue, Blueviolet, Brown, Burlywood, Cadetblue, Chartreuse, Chocolate, Coral, Cornflowerblue, Cornsilk, Crimson, Cyan, and many more. Each color can be applied with variations (Default, Light, Dark).
Color Variations
- Default: Standard scheme colors
- Light: Lighter shade variants
- Dark: Darker shade variants
Component Colors
Configure colors for each report element:
Headers and Totals
- Total Color: Background for total rows
- Total Text Color: Text in total rows
- Group Color: Group header background
- Group Text Color: Group header text
Data Areas
- Measures Color: Measure cell background
- Measures Text Color: Measure cell text
- Detail Color: Data row background
- Detail Text Color: Data row text
Alternating Rows
- Line by Line Coloring: Enable alternating colors
- Even Line Background: Even row background
- Even Line Foreground: Even row text
Band Specifications
Each band (section) has configurable properties:
Column Header Band
- Height: Header row height
- Font Size: Header text size
- Bold: Make headers bold
- Alignment: Left/Center/Right
- Background: Header background color
Detail Band
- Height: Data row height
- Font Size: Data text size
- Padding: Cell padding
- Borders: Cell borders
Summary Band
- Height: Summary section height
- Font Size: Total text size
- Style: Bold, italic, underline
- Separator: Line above totals
Grid Configuration
Grid Display Options
- Show the Grid: Display table borders
- Use White Grid: Light gray borders
- Grid Style: Solid, dotted, dashed
Grid Line Configuration
- Vertical Lines: Column separators
- Horizontal Lines: Row separators
- Outer Border: Table frame
- Inner Borders: Cell divisions
Conditional Styling
Apply formatting based on data values:
Style Conditions (5 Available Grids)
- Condition Expression: When to apply style
- Style Properties: What to change
- Priority: Order of evaluation
Common Conditional Styles
- Negative Values: Red text for negative numbers
- Thresholds: Color based on ranges
- Status Indicators: Color by status field
- Highlights: Bold important values
Example Conditions
$F{amount} < 0 → Red text
$F{status} == "Urgent" → Bold + Yellow background
$F{score} >= 90 → Green background
$V{ROW_COUNT} % 2 == 0 → Alternate row color
Background Images
Image Configuration
- Upload Image: JPEG, PNG, or GIF
- Opacity: 0-255 (0=transparent, 255=opaque)
- Size: Width and height in pixels
- Position: X and Y coordinates
Image Use Cases
- Watermarks: Company logo at low opacity
- Letterhead: Official document template
- Forms: Pre-printed form backgrounds
- Security: Copy protection patterns
Field Transparency
- Make Fields Transparent: Blend with background
- Keep Fields Opaque: Solid field backgrounds
Advanced Features
Security Constraints
Row-Level Security
Filter data based on user permissions:
- User-Based: Show only user's data
- Role-Based: Filter by user role
- Organization: Limit to user's organization
- Custom Rules: Complex security logic
Field-Level Security
Control field visibility:
- Hide sensitive fields
- Mask partial data
- Conditional visibility
Jasper Variables
Create custom variables for calculations:
Variable Types
- Sum: Running or group totals
- Count: Record counts
- Average: Mean calculations
- Min/Max: Extreme values
- Custom: User expressions
Variable Configuration
- Name: Variable identifier
- Expression: Calculation formula
- Reset Type: When to reset value
- Initial Value: Starting value
Header Components
Add custom elements to report headers:
Component Types
- Static Text: Labels and titles
- Dynamic Fields: Current date, page numbers
- Images: Logos and graphics
- Parameters: Display parameter values
- Custom: Expression-based content
Component Layout
- Position components precisely
- Layer multiple components
- Conditional display
Data Source Features
Subqueries
Use data sources as subqueries:
-- Main query gets customers
-- Subquery gets order count per customer
SELECT c.*,
(SELECT COUNT(*) FROM orders WHERE customerId = c.id) as orderCount
FROM customers c
Union Handling
Union Handling expressions allow you to transform and differentiate data from each source table in union queries:
Purpose: Apply different logic or transformations to data depending on which table it comes from.
Common Use Cases:
- Sign Conversion: Make returns negative while keeping sales positive
- Source Identification: Add labels to identify which system the data comes from
- Value Transformations: Apply different calculations per source
- Data Standardization: Normalize different formats to a common structure
Configuration:
- Each field can have a union handling expression
- Expression determines how to process the field value from each source
- Can reference the source table to apply conditional logic
Field Mapping with Different Column Names: When union tables don't share the same column names, you can map them:
- Main Table column:
customer_name
- Union Table column:
client_name
- System maps these as the same field in the report
Report Output and Export
Running Reports
Execution Options
- Run Report: Generate and display
- Download Report: Save to file
- Email Report: Send to recipients
- Schedule Report: Automatic generation
Output Formats
PDF
- High-quality printing
- Embedded fonts
- Searchable text
- Bookmarks and links
Excel
- Data export with formatting
- Auto-filter enabled
HTML
- Web browser viewing
- Interactive elements
Print Options
Direct Printing
- Send directly to printer
- Printer selection
- Copies and collation
- Page range selection
Print Settings
- Paper size matching
- Orientation handling
- Margin adjustment
- Scale to fit
Performance Optimization
Query Optimization
Use Temp Tables vs CTEs
- CTEs: Better for smaller datasets
- Temp Tables: Better for large datasets
- Configuration:
useTempTablesInsteadOfCTE
Pagination Control
- Enable: Load data in pages
- Disable: Load all data at once
- Configuration:
ignorePagination
Sorting Optimization
Before Groups Sort
- Sort data before grouping
- Improves group performance
- Configuration:
usedBeforeGroupsSort
Database vs Report Sorting
- Database: Faster for large datasets
- Report: Required for calculated fields
Data Loading Strategies
Lazy Loading
- Load data as needed
- Reduce initial load time
- Better for large reports
Eager Loading
- Load all data upfront
- Better for small reports
- Faster navigation
Index Utilization
Ensure Indexes Exist For:
- JOIN columns
- WHERE clause columns
- ORDER BY columns
- GROUP BY columns
Report Design Best Practices
- Limit Fields: Only include necessary fields
- Optimize Expressions: Simple expressions perform better
- Reduce Groups: Fewer group levels = faster processing
- Aggregate Early: Use SQL aggregation when possible
- Filter Early: Apply WHERE clauses to reduce data
Common Use Cases
Sales Reports
Monthly Sales Summary
- Main Table: SalesInvoice
- Groups: Month, Region, Salesperson
- Measures: Total Sales, Count, Average
- Parameters: Date range, Region filter
Customer Sales Analysis
- Main Table: Customer
- Data Source 2: SalesInvoice (linked)
- Groups: Customer Category, Customer
- Measures: YTD Sales, Last Year Sales, Growth %
Financial Reports
Income Statement
- Main Table: GeneralLedger
- Groups: Account Type, Account
- Measures: Debit, Credit, Balance
- Special: Hide zero balances
Aged Receivables
- Main Table: AccountsReceivable
- Groups: Aging Buckets (0-30, 31-60, etc.)
- Measures: Outstanding Amount
- Parameters: As-of date
Inventory Reports
Stock Status Report
- Main Table: InventoryItem
- Data Source 2: StockMovement
- Groups: Category, Item
- Measures: On Hand, Available, On Order
Movement Analysis
- Main Table: StockMovement
- Groups: Period, Movement Type
- Crosstab: Items × Months
- Measures: Quantity, Value
HR Reports
Employee List
- Main Table: Employee
- Groups: Department, Position
- Fields: Name, Hire Date, Salary
- Security: Salary visibility by role
Attendance Summary
- Main Table: Attendance
- Crosstab: Employee × Date
- Measures: Hours, Overtime
- Conditional Style: Highlight absences
Troubleshooting
Common Issues and Solutions
Report Runs Slowly
Causes & Solutions:
- Large Dataset: Enable pagination, use filters
- Complex Expressions: Simplify or move to SQL
- Many Groups: Reduce grouping levels
- Missing Indexes: Add database indexes
Data Not Appearing
Check:
- WHERE conditions excluding data
- Security constraints limiting access
- JOIN conditions too restrictive
- Parameter default values
Incorrect Totals
Verify:
- Aggregation type (SUM vs COUNT)
- Group reset settings
- Duplicate data from JOINs
- NULL value handling
Formatting Issues
Review:
- Pattern configuration
- Locale settings
- Font availability
- Color scheme selection
Validation Errors
"Fields grid validation failed"
- Check field references are valid
- Ensure expressions are syntactically correct
- Verify field types match usage
"Group validation failed"
- Ensure group fields are selected
- Check group expressions are valid
- Verify group totals configuration
"Parameter validation failed"
- Parameter names must be unique
- Default values must match type
- Required parameters need defaults
Performance Tips
For Large Reports (>10,000 rows)
- Use database sorting
- Enable pagination
- Limit visible fields
- Use summary reports with drill-down
For Complex Calculations
- Pre-calculate in database views
- Use jasper variables efficiently
- Cache repeated calculations
- Optimize expression complexity
For Multiple Data Sources
- Use appropriate join types
- Consider subqueries for aggregations
- Limit cross-products
- Filter early in each source
Debug Mode Features
When troubleshooting:
- View Generated SQL: See actual query
- Expression Evaluation: Test expressions
- Preview with Sample Data: Limited dataset
- Execution Plan: Database query plan
- Performance Metrics: Time per phase
Best Practices
Report Design
- Start Simple: Begin with basic report, add features gradually
- Test Incrementally: Verify each section works before adding more
- Use Templates: Copy successful reports as starting points
- Document Purpose: Use descriptions and comments
Naming Conventions
- Report Codes: Use prefixes (FIN_, HR_, SALES_*)
- Field Aliases: Meaningful names for expressions
- Parameter Names: Clear, user-friendly labels
- Group Names: Hierarchical naming
Maintenance
- Version Control: Keep report backup before major changes
- Change Documentation: Document modifications
- Test After Updates: Verify after entity changes
- Regular Review: Audit report usage and performance
Security
- Least Privilege: Only grant necessary access
- Test Security: Verify constraints work correctly
- Audit Sensitive Reports: Log access to confidential data
- Regular Reviews: Update security as roles change
User Experience
- Clear Parameters: Provide helpful parameter descriptions
- Meaningful Defaults: Set sensible default values
- Consistent Formatting: Use standard formats across reports
- Helpful Totals: Include relevant subtotals and grand totals
- Error Messages: Provide clear guidance when issues occur
Appendix
Field Type Reference
TextDF
: Text fieldsIntegerDF
: Whole numbersDecimalDF
: Decimal numbersBooleanDF
: True/False valuesDateDF
: Date fieldsDateTimeDF
: Date and time fieldsLongTextDF
: Large text fieldsFieldID
: Entity field references
SQL Aggregation Functions
SUM()
: Total of valuesCOUNT()
: Number of rowsCOUNT(DISTINCT)
: Unique valuesAVG()
: Average valueMIN()
: Minimum valueMAX()
: Maximum valueGROUP_CONCAT()
: Concatenated textSTDDEV()
: Standard deviationVARIANCE()
: Statistical variance
Jasper Expression Functions
$F{fieldname}
: Field value$P{parameter}
: Parameter value$V{variable}
: Variable value$R{resource}
: Resource bundlePAGE_NUMBER
: Current pageREPORT_COUNT
: Total recordsROW_COUNT
: Current row
Date Format Patterns
dd/MM/yyyy
: 31/12/2024MM/dd/yyyy
: 12/31/2024yyyy-MM-dd
: 2024-12-31dd MMM yyyy
: 31 Dec 2024MMMM dd, yyyy
: December 31, 2024EEEE, MMMM dd, yyyy
: Tuesday, December 31, 2024
Number Format Patterns
#,##0
: 1,234#,##0.00
: 1,234.00#,##0.00;(#,##0.00)
: 1,234.00 or (1,234.00)0.00%
: 12.34%$ #,##0.00
: $ 1,234.0000000
: 01234
Color Codes (Hex)
#000000
: Black#FFFFFF
: White#FF0000
: Red#00FF00
: Green#0000FF
: Blue#FFFF00
: Yellow#808080
: Gray#E6E6E6
: Light Gray
Technical Appendix
Complete Entity Structure
ReportWizard Entity Technical Details
Entity Information:
- Entity Type: ReportWizard
- Arabic Name: أداة إنشاء تقرير
- English Name: Report Wizard
- Database Table: ReportWizard
- Classification: Master File (not Document File)
Key Header Fields:
- Layout & Design:
layoutMethod
,pageFormat
,pageOrientation
,colorScheme
,variation
- Data Sources:
mainTable
,dataSource1
-dataSource5
,tableType
,entityType
- Sorting:
sortMethod
,sortParametersCount
,ascendingOrDescending
,usedBeforeGroupsSort
- Grouping:
useGroupsAsParameter
,startNewPageGroup1
-startNewPageGroup5
- Performance:
useTempTablesInsteadOfCTE
,ignorePagination
,usedBeforeGroupsSort
- Security: View, update, and usage capabilities with row-level constraints
- Crosstab:
crosstabCellWidth
,crosstabCellHeight
,displayCrosstabMeasuresVertically
Complete Collection List (32 Collections):
- fields (الحقول) - Field definitions
- parameters (المدخلات) - Parameter configurations
- userAliases - User-defined field aliases
- headerComponents - Header layout components
- sortFields (حقول الترتيب) - Database sort field definitions
- group1Lines through group5Lines (سطور المجموعة 1-5) - 5-level grouping
- group1HeaderCustomExpressionLines through group5HeaderCustomExpressionLines - Group header expressions
- group1FooterCustomExpressionLines through group5FooterCustomExpressionLines - Group footer expressions
- unionTables - Union table configurations
- whereLines - WHERE clause conditions
- jasperSortFieldsLines - Jasper sort configurations
- jasperVariables - Custom Jasper variables
- dataSource1FilterLines through dataSource5FilterLines - Multi-source filtering
- dataSource1LinkingLines through dataSource5LinkingLines - Multi-source linking
- printWhenExpressionLines - Conditional printing rules
- crosstabColumns (الأعمدة) - Crosstab column fields
- crosstabRows (الصفوف) - Crosstab row fields
- crosstabMeasures (المعادلات) - Crosstab measure fields
- securityConstraints - Security constraint rules
- conditionalStyleLines1 through conditionalStyleLines5 (جدول التنسيق الشرطي 1-5) - 5 grids of conditional formatting
- includeTablesByParameters (تضمين الجداول بشرط من خلال مدخلات) - Dynamic table inclusion
Enum Field Values:
- sortMethod:
SortBasedOnSortFields
(ترتيب محدد من خلال حقول الترتيب),SortBasedOnReportParameter
(ترتيب من خلال مدخلات يقوم باختيارها المستخدم) - parametersPosition:
FirstPageHeaderOnly
,AllPagesHeader
,AllPagesFooter
,None
,GroupHeader
,GroupFooter
,LastPageFooter
,Summary
- colorScheme: 100+ predefined colors from
Aliceblue
toYellowgreen
- layoutMethod:
Manual
,FromUploadedFile
,FromEditor
Integration with Nama ERP
The ReportWizard integrates deeply with the Nama ERP system:
- Entity Integration: Can report on any entity in the system
- Security Integration: Respects user permissions and organizational constraints
- Multi-Language: Full Arabic/English support in field names and UI
- Performance Optimization: Advanced query optimization and caching
- Export Capabilities: Multiple output formats (PDF, Excel, HTML)
This comprehensive documentation provides users with detailed information about every aspect of the ReportWizard, from basic setup to advanced features, complete with examples, best practices, troubleshooting guidance, and technical implementation details using accurate system translations and field information.