The "Export Data" Window
It can be useful to pick a few records from a Business-Object, and show a few columns of each record's data in a grid.
Orixa has a Export Data mechanism to allow this to be done.
Not all Business-Objects have "Export-Data" switched on, so you will not see this feature in all your Business-Objects. If you need to extend your system and switch it on, your administrator can do this fairly easily.
All that is needed is to add the Decoration :
"DESCRIPTION '[Properties]
AddDataExport=1'
to the BusinessObject data-table definition.
Exporting data from a business-object
To open the "Export Data" window, start from the "Actions" menu, and select it, as shown below.
Accessing the "Export Data" Action
Components of the Business Object Data Exporter Window
The Business Object Data Exporter
- The name of the Business Object who's data you are exporting
- The "Records to Find" List. This will show records once you select them in the next step.
- The Fields List, this shows all the fields in one table of the Business Object. Note that if the Business Object has multiple tables multiple tabs will show.
- The SQL Editor. This shows the SQL Code that will return the records you want from the database. This is useful as you can add to and amend this SQL if you need to, to change the data that is returned.
- Buttons to "Show Data" and Close the window.
- At the bottom of the window an information panel explains how to use different parts of the window.
Selecting Records and Fields
Selecting Records and Fields
- Double-click on the "Records to find" field and a list of records will open. Tick the ones you want to view after export. Note this list can be searched by clicking on it and typing, which will filter the list.
- Click on the fields you want to view. Note there may be more than one heading, with different fields listed in each one.
Showing Data
Showing data, and exporting it to a new format
- Once you have selected the records and fields you want to view, click "Show Data" to open a grid containing the records. Note once the grid is open you can arrange and group the fields and columns into a form you are happy with, before exporting to Excel, HTML or PDF.
- Click the grid's "print / export" button and select the type of file you want, and save it so you can use the data outside of you Orixa App.
Advanced features
SQL Editor
SQL Editor in the Data Exporter
The image above shows some typical SQL generated by the Data Exporter. You can edit this SQL. For example you could extend the list of IDs by adding additional ones you know you need to view, or add other data-tables to the SQL using JOINs. Actually undertaking these changes to the SQL is beyond the scope of this article, please review other Orixa help-pages searching for "SQL" for more information.
An important limitation of the Data Exporter
In the above image showing SQL you can see that one field is listed as "C1.ContractsTypeID", when this SWL is run the following data appears:
Exporting an "ID" field
You can see that the "ContractsTypeID" field is exported as a number not as readable text.
If you want to see readable text instead of the number, you must manually extend the SQL in the SQL editor, adding a JOIN to the "Types" table. This is a somewhat complicated bit of SQL coding, but is not difficult to learn.
Modify the SQL shown in the image above so it looks like this:
SELECT
C1.ID,
C1.DateStart,
C1.DateEnd,
C1.Name,
T.Name as ContractsType,
C1.Description,
C1.Current
FROM Contracts C1
LEFT JOIN Types T ON T.ID = C1.ContractsTypeID
WHERE C1.ID IN (29919, 36963, 65649, 13487, 20111)
Note that the number field "ContractsTypeID" has been removed from the SELECT part of the SQL and replaced with "T.Name as ContractsType", and a JOIN has been added to the Types table "T".
Once this change is made, the data will show as in the image below, with the "ContractsType" field rendered as readable text.
Exporting an "ID" field so it can be viewed as readable text