How to create a Custom Export


This article explains how to create a Customized Export in APM


Introduction

Customized Export is a powerful utility that allows you to extract any information from Adonis into the external file (different formats are available).

Setup and Configuration

Customized Export is setup and configured under the Setup → General Codes → Export.

To add a new custom export click New button.

The following window will open. It contains the information about the new export.

Let's take a look at it in detail.

General settings

Code - is a mandatory field that serves as a unique identifier of this export in the system.
Should be max 10 symbols long, capital letters only, spaces and some of the special signs are not allowed (e.g. !,?,*,%);

Sort - defines the order of this export in the list.
The codes with the smallest Sort will be shown first in the list.
Only values in range 0-999 are allowed;

Text - export name.

Alternative Text - alternative name (e.g. in another language).

Is Passive - when this option is ON, the export will be set as inactive (in case it is no longer used).

Security Code - When the Security No is added (in range from 1-999), the selected custom export will appear in Adonis Control Centre (ACC) under the General Codes > Customized Export tab.
It will be then possible to set up different access rights to it (Read, Write, None) for different users' levels. 
By default, the access will be set to None for all the levels. If no Security No is added (i ts 0), the export will not be available in ACC and all the users will be able to run it.

Options tab

Under the Options tab we add all the export parameters.

Template section

The Template section contains the structure of our export.

  1. The top level is called Export Template. It is default and can not be removed.
    Here we define export file format and it's properties.
    Under this tab we also configure dialogue window parameters for our export, if we have any.
    e.g. Date, Period, PIN selection etc.

  2. The next level in the structure is called Sections (Group and Fields sections). 
    Here we specify sql selection that will be used for the export and declare dialogue window parameters to be used.

  3. The 3rd level is called Fields.
    Here we specify specify which fields we want our export file to contain (based one sql statement from the Sections).
    For the field to work it should bear the name corresponding to the column extracted in our sql select statement.

Let's take a closer look at each of those levels in detail.

Level 2: Sections (Group and Fields).

Sections is the first part of the export that we need to configure and it can be of 2 types:

  • Fields section - unites fields into a single group under it.

  • Group section - combines several Fields sections into a group. It is optional.

To add new Section right click on the top level > Insert > Group/Section.

Under Sections we specify sql selection that will be used for the export and declare dialogue window parameters to be used.

To add a dialogue window parameter you need to use the following reference <:PARAMETER_NAME> in sql statement. Usually we add it with declare statement e.g. Declare @PIN varchar = <:PIN>

Level 3: Fields

Here we specify specify which fields we want our export file to contain (based one sql statement from the Sections).

To add new field right click on the Fields Section > Insert > Field and select the format of the field that you need (Sting, DateTime, Integer, Float).

After the field is added you can configure it.

The following options are available:

Type -defines whether this is a data field or a parameter field (can be referred to in another Fields Section).

Field Name - the name of the field.
For the field to work it should bear the name corresponding to the column extracted in our sql select statement.


Default - you can set a default value to be displayed in the field.
e.g. if you want to have a column containing the same value for all the rows of the exported file.

Caption -here you can specify the name of the column to be displayed in the exported file, by default Field Name is displayed.

Length - in this field we can set maximum allowed length to the field in the exported file. Default is 0.
When set to 0, the actual length of each field will be exported, so usually we advise to leave with 0.
If you set the length other than 0 (e.g. 50 symbols), then the exported values that are longer will be reduced and for the values that are shorter the system will add additional spaces.

Max Length - the field should correspond to the max length of this field in the database.
When set to 0, the actual length of each field will be exported, so usually we advise to leave it unchanged.

Filler - allows to define a sign that will will empty spaces in the column.
e.g. if Filler is set to 0, and column length is 10 symbols, but the extracted value is 2 symbols, the remaining 8 spaces will be filled in with zeroes.

Align - allows to set default aliment to the exported field.

Based on the type of the field that you selected (Sting, DateTime, Integer, Float) there may be some additional fields available for configuration.

Level 1: Export Template

The top level is called Export Template. It is default and can not be removed.
Under this tab we:

  1. Configure dialogue window parameters for our export, if we have any.
    The dialogue window parameter should be previously specified in the sql selection. See Level 2: Sections (Group and Fields) for more details.

  2. Define export file format and it's properties.

How to run Custom Export

Once the export has been created and setup it will be available under Tools > Export > Custom Export.

If you run it, the dialog window will open up with with parameters that you defined and Path to the folder where the file will be saved.

It might take a while for the export file to be generated, since the system first creates s temporary table with the selection and only after then saves this selection into a file.