Data Sources
A Data Source is required by each Ad Hoc report component to display any data. Besides the support for data sources in the i-net Clear Reports server, there is support for data templates built up on the previously mentioned data sources, as well as custom data sources provided, e.g by upload.
Custom Data Sources can be used, depending on the user permissions. Custom data sources are files in CSV
, JSON
, or XML
format. File upload can be enabled in the configuration and allows the selection of data source files from the client file system. Users with access to the Drive can select data sources from there. Additionally, users with the configuration privileges can select files from the server file system.
CSV Data Format
CSV files can be created, e.g. using the export from Excel. But the CSV implementation also supports reading log files, e.g. from Apache, and event log files from this i-net Clear Reports server. This means that columns are recognized and headers automatically generate column names. The datatypes are derived from the column contents.
Example:
"Date","UserId","User","Event","Message" 2025-01-30T15:55:29.769Z,,,"ServerStarted","The process of the application was started with version 25.4.136.", 2025-01-30T15:55:34.508Z,,,"ConfigurationChanged","Configuration property ""setupChain"" changed.", 2025-01-30T15:55:34.980Z,,,"ConfigurationChanged","Configuration property ""licensekey"" changed.",
JSON Data Format
The JSON data format requires the file to be in a data format that is one of the following:
-
A list of data objects. The objects' keys are the column names.
-
A map of lists with objects. Here, the maps' names are used as table names.
Example: List
[ { "id": 1, "firstname": "Hans", "lastname": "Gruber" }, { "id": 2, "firstname": "Colonel", "lastname": "Stuart" }, { "id": 3, "firstname": "Simon", "lastname": "Gruber" } ]
Example: Objects of lists of objects. Here, two tables villains
and heroes
are created.
{ "villains": [ { "id": 1, "firstname": "Hans", "lastname": "Gruber" }, { "id": 2, "firstname": "Colonel", "lastname": "Stuart" }, { "id": 3, "firstname": "Simon", "lastname": "Gruber" } ], "heroes": [ { "id": 1, "firstname": "John", "lastname": "McClane" }, { "id": 2, "firstname": "Al", "lastname": "Powell" }, { "id": 3, "firstname": "Zeus", "lastname": "Carver" } ] }
XML Data Format
The XML data source format also allows multiple tables being defined. Here is an example of an XML file:
<?xml version="1.0" encoding="UTF-8"?> <dataroot> <Villain><id>1</id><FirstName>Hans</FirstName><LastName>Gruber</LastName></Villain> <Villain><id>2</id><FirstName>Colonel</FirstName><LastName>Stuart</LastName></Villain> <Villain><id>3</id><FirstName>Simon</FirstName><LastName>Gruber</LastName></Villain> <Hero><id>1</id><FirstName>John</FirstName><LastName>McClane</LastName></Hero> <Hero><id>2</id><FirstName>Al</FirstName><LastName>Powell</LastName></Hero> <Hero><id>3</id><FirstName>Zeus</FirstName><LastName>Carver</LastName></Hero> </dataroot>