Exporting a Report Model

Astera ReportMiner makes it easy to export data from a report model directly to a number of different destination types such as excel and csv. Moreover, it supports export of data to a wide range of on-premise and cloud databases including SQL Server, Oracle, DB2, Sybase, MySQL etc.

In this document, we will learn how to export data in a report model to three different destination types.

Sample Use-Case

In this example, we have incoming data extracted by the report model below.

Download the sample data file and report model from here.

1_model

The model contains a hierarchical structure with three data regions and multiple fields.

Click on Preview Data icon icon_4 placed in the toolbar above ReportMiner’s designer. A Data Preview window will open, displaying the extracted data.

36_data

Let’s export the data extracted by this report model to an excel destination, a csv file and a SQL database table.

Exporting to an Excel Destination

1. Select the Create New Export Settings and Run (to Excel) icon placed in the toolbar under the Model Layout panel.

2_export_icon

A configuration window will open. This is where the export properties are defined.

3_config

2. Provide File Path where ReportMiner will save the exported data with a .xls extension.

4_file_path

Once you have provided the destination file path, you can choose multiple options from the export setting window to configure the data export file.

5_options

  • First Row Contains Header – directs ReportMiner to read headers from the source file.
  • Worksheet – specifies the title for the worksheet to export the data to within the excel file.
  • Append to File(If Exists) – adds the exported data to an existing excel sheet without overwriting the data it contains.
  • Write to Multiple Files – saves the exported data to multiple files instead of one single file. Specify the same file in multiple excel destinations and ReportMiner will create a single file with multiple worksheets and writes all data to that file.

6_rule

Rules for Filtering – specifies a criterion to export only filtered records to an excel sheet. On expanding, users can see an expression box with built-in functions to facilitate a rule-based filtering. This feature is explained in detailed in the next section.

3. Click Next. This is the Layout Builder screen where the extracted data fields can be modified as per the requirements.

7_layout

4. Click OK, this starts the export of data. View it’s job trace in the Job Progress window.

8_job_progress

At the end of a successful run, ReportMiner will generate the excel file and provide it’s clickable link in the job trace.

9

The export to an excel sheet is complete.

Exporting to a CSV File

1. Select the Create New Export Settings and Run (to CSV) icon placed in the toolbar under the Model Layout panel.

10_csv

A configuration window will open. This is where the export properties for CSV files are defined.

11_confog

2. Provide File Path where ReportMiner will save the exported data with a .csv extension.

12_file_path

Once file path has been provided, move on to other options to configure the exported file.

13_options

  • First Row Contains Header – directs ReportMiner to read headers from the source file.
  • Field Delimiter – allows users to select a delimiter from the drop-down list for the fields.
  • Record Delimiter – allows users to specify any delimiter for the records within fields.
  • Encoding box – allows users to choose the encoding scheme for the csv file from a list of choices. The default value is Unicode (UTF-8).
  • Text Qualifier – is a symbol that identifies where text begins and ends. It is used specifically when importing data rather than exporting.
  • Apply Text Qualifier to All Fields – adds the specified qualifier to all the incoming fields.
  • Null Text – directs ReportMiner to replace a certain value in the report model with a null value.
  • Append to File(If Exists) – adds the exported data to an existing csv file without overwriting the data it contains.
  • Hierarchical Destination – sorts the incoming data into hierarchies where necessary.
  • Write to Multiple Files – saves the exported data to multiple files instead of one single file.
  • Rules for filtering data – specifies a criterion to export only filtered records to a csv file. On expanding, users can see an expression box with built-in functions to facilitate a rule-based filtering. This feature is explained in detailed in the next section.

3. Click Next. This is the Layout Builder screen where the extracted data fields can be modified as per the requirements.

14_layout

4. Click OK, this starts the export of data. View it’s job trace in the Job Progress window. At the end of a successful run, ReportMiner will generate the csv file and provide it’s clickable link in the job trace.

15_job

The export to a csv file is complete.

Exporting to Database Table

1. Select the Create New Export Settings and Run (to Database) icon placed in the toolbar under the Model Layout panel.

16_db

A configuration window will open. The first screen is the Database Connection screen. If a connection has been recently set up, access it’s configuration settings through Recently Used option.

17_connection

2. Select the required Data Provider from the drop-down list. In this example, we are exporting data to a SQL Server database table.

22

3. Establish a connection with the database by filling in all the necessary details.

18_set_up

Click on Test Connection button and ReportMiner will notify the user upon successful connection.

23_connection_test

4. Click Next. On this screen, either pick an existing table or create a new table for export data. In this example, we have created a new table called Invoice_FurnitureMart.

19_Pick_Table

Once a database table has been specified move on to other options to configure the database table as per your requirements.

20_other_options

  • Define Input Ports for Mapping – defines a writing strategy to the database table for each record. For example, if the data is being exported to an existing database table then users can also enable update and upsert options for each record.
  • Database Options – deals with system generated keys and null values.
  • Data Load Options – specifies the type of insert of your records into a destination database. Records can be inserted in a bulk or each record at a time.

5. Click Next. This is the Layout Builder screen where the extracted data fields can be modified as per the requirements.

21_layout_builder

6. Click OK, this starts the export of data. View it’s job trace in the Job Progress window.

22_job_progress

The export to a SQL Server database table is complete.

Rule-Based Filtered Export

Astera ReportMiner enables users to specify a criterion to export only filtered records to the destination file. This option is available when data is exported to an excel sheet or a csv file.

1. Select the export destination of your choice. In this example, data in a report model is being exported to an excel sheet. On it’s configuration window, after specifying the properties, expand Rule for Filtering Data.

24_rules

On expanding, users can see an expression box with built-in functions to facilitate a rule-based filtering. Expand the Record_Export node to access the fields of the extracted data.

44_filter

Now, we only want to export data that contains SOFA in the Items field. For that we have to specify an expression in the expression builder.

2. In the expression builder, write Contains(“SOFA”,Items). Click on the Compile button to verify whether the expression is successful or not.

45_Expression

Click OK to close the export settings window.

3. Now click on Run Selected Export icon placed in the toolbar under the Data Export Settings panel.

25_RUN

Export will begin. Observe its trace in the Job Progress window.

46_job_progress

At the end of a successful export, ReportMiner will generate the excel file with filtered records and provide its clickable link in the job trace.

26_LINK

This completes rule-based filtered export.