universal-export-engine
Service icon

Universal Export Engine

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 31 December 2025
 by 
5.0
 (1 rating)
universal-export-engine

Universal Export Engine

Compatible with:
Created on OutSystems 11

Version 1.0.0

Stable
Current
See documentation
Uploaded on 31 December 2025 by 
Compatible with:
Version 11
Database:
All
License:

📋 Universal Export Engine – Detailed Technical Documentation

🎯 Overview

Universal Export Engine is a .NET Extension Service designed for the OutSystems Platform.It enables exporting any data type to Excel (.xlsx), PDF, or CSV with extensive customization, security, and localization support.

Core Principle:Export once – use everywhere – handle everything

📦 Architecture & Components

Class Structure

public class CssUniversal_Export_Engine : IssUniversal_Export_Engine

  • Implements: IssUniversal_Export_Engine

  • Namespace: OutSystems.NssUniversal_Export_Engine

  • Type: .NET Library (DLL)

  • Framework: .NET Framework 4.8

🔢 Constants & Enum Values

Export Formats

  • EXPORT_FORMAT_EXCEL = 1 → Excel (.xlsx)

  • EXPORT_FORMAT_PDF = 2 → PDF (RTL, Watermark, Security)

  • EXPORT_FORMAT_CSV = 3 → CSV (UTF-8, Culture-aware)

Delivery Types

  • DELIVERY_TYPE_DOWNLOAD = 1

  • DELIVERY_TYPE_EMAIL = 2

  • DELIVERY_TYPE_STORAGE = 3

Page Configuration

  • PAGE_ORIENTATION_PORTRAIT = 1

  • PAGE_ORIENTATION_LANDSCAPE = 2

  • PAGE_SIZE_A4 = 1

  • PAGE_SIZE_LETTER = 2

Text Alignment

  • TEXT_ALIGNMENT_LEFT = 1

  • TEXT_ALIGNMENT_CENTER = 2

  • TEXT_ALIGNMENT_RIGHT = 3

Column Data Types

  • COLUMN_DATA_TYPE_TEXT = 1

  • COLUMN_DATA_TYPE_NUMBER = 2

  • COLUMN_DATA_TYPE_DATE = 3

  • COLUMN_DATA_TYPE_CURRENCY = 4

  • COLUMN_DATA_TYPE_BOOLEAN = 5

🛠 Helper Methods – Data Conversion

ConvertRLStringListToList(...)

Purpose: Convert RLStringListRecordList to List

Process:

  • Iterate records

  • Extract ssValue

  • Return standard .NET list

Usage: Email recipients from OutputConfig.ssAttribute

Default Configuration Methods

  • GetDefaultExportOptions()

  • GetDefaultLayoutConfig()

  • GetDefaultLocalizationConfig()

  • GetDefaultSecurityConfig()

  • GetDefaultPerformanceConfig()

  • GetDefaultOutputConfig()

Purpose: Apply defaults when configs are nullDefaults Source: Structures.cs

🔄 Data Processing Methods

ProcessData(...)

Input: Any OutSystems dataOutput: List>

Flow:

  1. Serialize to JSON

  2. Parse JSON (JArray / JObject)

  3. Reflection fallback

  4. Optional flattening

  5. Null-safe handling

Handles: empty, null, nested, mixed types, arrays

ProcessJsonObject(...)

  • Recursive JSON processing

  • Flattens nested objects

  • Arrays → comma-separated values

  • Preserves key hierarchy

ConvertObjectToDictionary(...)

  • Reflection-based conversion

  • Recursive flattening (optional)

  • Skips unreadable properties

IsSimpleType(...)

Simple types:

  • Primitives, string, DateTime, decimal, Guid, Nullable

GetValue(...)

  • Extracts value from JValue

  • Returns raw object otherwise

📊 Column Processing Methods

CleanColumnName(...)

Removes OutSystems prefixes and formats names.

Examples:

  • ssENEmployee._ssName → Name

  • Customer.Address.Street → Street

  • _Status → Status

ShouldExcludeColumn(...)

Hardcoded exclusions:

  • ChangedAttributes

  • OptimizedAttributes

ProcessColumns(...)

Modes:

  • Auto-Detect: Extract from data

  • Manual: Use provided config

Applies:

  • Exclusions

  • Clean names

  • Data type detection

  • Sorting by order

DetectDataType(...)

Samples first 10 non-null values:

  • Number

  • Date

  • Boolean

  • Default → Text

FormatValue(...)

Formats based on column data type:

  • Boolean → Custom text

  • Date → TimeZone + format

  • Number → Culture-aware

  • Currency → Culture-aware

  • Null → NullValueText

✅ Validation Methods

MssValidateExportDefinition(...)

Validates:

  1. Data existence

  2. Export format

  3. Column config

  4. Layout config

  5. Security config

  6. Performance config

  7. Output config

Returns: RCValidationResultRecord

  • Errors (blocking)

  • Warnings (non-blocking)

📄 Export Methods

ExportToExcel(...)

  • Library: ClosedXML

  • Headers, widths, alignment

  • Data formatting

  • Auto-fit columns

Returns: byte[]

ExportToCSV(...)

  • UTF-8 encoding

  • Culture-aware formatting

  • Proper CSV escaping

Returns: byte[]

ExportToPDF(...)

  • Library: iTextSharp

  • Page size & orientation

  • Headers / Footers

  • Watermark & security

  • RTL & font fallback

Returns: byte[]

🚀 Main Public Functions

MssExportData(...)

Main entry point

Flow:

  1. Apply defaults

  2. Process data

  3. Limit rows

  4. Process columns

  5. Export by format

  6. Generate filename

  7. Populate result

MssPreviewExport(...)

  • Exports first N rows

  • Prefixes filename with Preview_

  • Used for testing & validation

MssValidateExportDefinition(...)

  • Pre-execution validation only

🔧 Helper Class – ColumnInfo

Internal structure holding:

  • ColumnKey

  • DisplayName

  • Visibility

  • Order

  • DataType

  • Format

  • Width

  • Alignment

  • WrapText

  • DefaultValue

📚 Dependencies & Libraries

NuGet:

  • ClosedXML (MIT)

  • DocumentFormat.OpenXml (MIT)

  • iTextSharp (AGPL)

  • Newtonsoft.Json (MIT)

OutSystems Runtime:

  • RuntimePlatform

  • DatabaseAbstractionLayer

  • RuntimeCommon

  • REST & SOAP APIs

✨ Key Features & Capabilities

  • Dynamic data handling

  • Smart column detection

  • Advanced formatting

  • Full localization & RTL

  • PDF security

  • Performance optimization

  • Large dataset support (1M+ rows)

  • Robust edge-case handling

📌 Important Notes

  • All configurations are optional

  • No assumptions about data shape

  • Full error & exception handling

  • Optimized for scale

  • Easily extensible

Application Objects:
Universal Export Engine has 0 AOs.