ExSION for Dynamics AX

Easily retrieve data from the Dynamics AX database with ExSIONAX.

A product of:
Exsion365 B.V.
Boerhaavelaan 40
2713 HX Zoetermeer
The Netherlands
T +31 182 441 340

Preface

ExSION for Dynamics AX, short ExSIONAX is an Excel add-in designed specifically for quick and easy presentation of data from the Dynamics AX database. It combines the functionality and presentation power of Excel with a real-time link to the database. So you can refresh short A4 reports on any moment within a few seconds for different companies and different periods.

With ExSIONAX you are no longer dependent on the static form of reporting with Dynamics AX, but you can determine how a report is defined and in which presentation format. By making use of colors and graphs, the presentation value can be increased considerably.

Suppose there are already reports created in Excel in some kind of format. Every period the data will be entered or copied from Dynamics AX. It is now possible to refresh such data in a simple way with ExSIONAX reports. This is done by replacing all the fields that would normally be typed in, to ExSIONAX functions that retrieve the data from the database.

ExSIONAX has three methods to retrieve data from the database:

These methods are described in the following chapters.

Menu functions

ExSIONAX can be identified by the ExSIONAX tab in the Ribbon. Clicking that tab will show the menu below.

The functionality of menu options from the ExSIONAX menu are described below.

Connection

First a connection must be created to connect ExSIONAX the Dynamics AX database. The first time ExSIONAX is used, you can only choose for the menu item “New connection”.

After a choosing an item from this submenu, the following screen will appear:

By pressing the “SAVE” button, the connection is saved. The “REMOVE” button deletes a previously saved connection.

Field Description
IDThe Identification of the database connection is a number between 1 and 999 and is the first argument in all the ExSIONAX functions. To retrieve data over the connection that you create, you should use the number from the ID field. By default the ID will increase by one for each new database connection.
Windows authenticationUsing windows authentication is preferred to connect to the Dynamics AX database. When this option is enabled there User-ID and Password cannot be entered.
User-IDUser-ID with access to the Dynamics AX database.
PasswordPassword associated with the User-ID.
ServerMSSQL Server name (or IP address) where the Dynamics AX database is installed.
DatabaseThe name of the Dynamics AX database.
CompanyThe name of the Company you want to connect to.

Database structure

This function maps the complete database structure, including custom tailored modules. It works as a street guide of your Dynamics AX application. It can give you a deeper insight of the data model of your Dynamics AX environment.

After activating the menu item, the following screen is displayed.

After the OK button is pressed, the database structure is shown for the selected connection.

By pressing on the table name, the detail information is shown.

Function library

You can build a library of functions, which will always be present regardless in what Excel file you are working. An advantage of creating functions by this method is that you can add descriptive text to the function and its arguments.

A disadvantage is that the Excel files are not default exchangeable between users. Other users must also define this function(s) in their function library. When installing ExSIONAX you can choose to put the function library in a shared folder, so that all users have access to these functions.

After starting this function you have an overview of functions from the library. If no functions are defined, this list is empty.

You can choose for “New” to create a new function or “Modify” to modify an existing function.

In this example we'll change the function CUSTBALANCE:

Field Description
TableThe table from which the function retrieves data.
FieldThe field to be retrieved using this function.
MethodChoice of calculation type on the field (SUM, MIN, MAX, AVG or CNT).
IndexThe index to be used. The fields in the index will be used as arguments to the function (see step 2).
NameName of the function which will be defined.
DescriptionA brief description of the function (this description will be displayed in the function wizard of Excel).
DisplayChoice for displaying the table/field description or name from the database.
Connection-IDThe ID number of the database connection.

After the button “>>”, the function arguments are displayed (for the selected index):

Field Description
NameBy default the field name of the table will be used, but can be changed to increase the user’s experience.
DescriptionA brief description of the argument (this description is displayed in the function wizard of Excel).
Filter (fixed)When entering a fixed filter, the argument is no longer displayed in the function wizard of Excel.
HideIndicates whether the argument should be hidden in the function wizard of Excel.

After pressing the “OK” button the function is added to the function library.

The created function can be found in the function wizard of Excel under the category “ExSIONAX Library”:

Example of the newly created function:

Function definition

Database functions are using as second argument (Definition) a range in which the table and index fields are defined and a third argument (Field) which defines the field name whose value is to be retrieved. This menu option easily defines both ranges.

Definition

To define the range in which the table and index fields are included, you can choice the option “Definition”.

The following screen is displayed after entering this menu option.

The “Open customer transactions” table is selected with Index “Customer account, Date”.

After pressing the “OK” button, ExSIONAX asks to enter a name, which will be given to the function definition:

And the table- and index information will be copied to the active cell in your worksheet. The following screen shows this on A1 to B3.

The next step is to create a field range, you can do this by choosing for the menu option “Field”.

Field

In order to create a range in which the field name is defined, you must choose the option “Field”:

In the next screen, you can search for a field within a table.

After you have pressed on the “OK” button, the field with the description is copied to the active cell:

The defined ranges may be used in the function ExSIONAX_DBSUM.

See chapter Database functions, for a list of functions that use function definitions.

Formulas to values

This option will remove all ExSIONAX functions while preserving their resulting values and can be used if you want to send your worksheet with the current values to a non ExSIONAX user.

Note: This is not reversible so it is important to first save your worksheet before performing this action.

Without the ExSIONAX functions the data cannot be refreshed anymore.

Show details

This option will show information based on the ExSIONAX formula in the active cell. After activating the button “Show details”, a new workbook will be created with two worksheets.

The first sheet is called “DATA”, and will have the data that was retrieved from the database as defined by the function in the active cell of your worksheet.

The second one is called “ExSIONAX” and will have a “Dynamic download” definition based on the same function.

You can use the “Refresh data” button to refresh the data on the “DATA” sheet.

See example below:

The new workbook with the “DATA” and “ExSIONAX” worksheets:

As you can see, the download definition is based on the function arguments:

Dynamic download

By means of a dynamic download data can be retrieve from the database in to Excel. In contrast to the use of functions, large amount of data can be retrieved at ones.

When the function is called for the first time, the following screen is shown.

Field Description
AddThis lists all the tables from the database.
SearchHere you can enter a search filter to find the table(s) you are looking for.
FilterFilter on type TABLE or VIEW.
DisplayChoice for displaying the table/field description or name from the database.
Connection-IDThe ID number of the database connection.
>>Adds all fields from the table to the selected fields list.
>Add a field from the table to the selected fields list (can also be done by double-click on the field).
<Removes a field from the selected fields list. You can also double-click to select and remove a field.
<<Removes all fields from the selected fields list.
JOINWhen multiple tables are selected, relationships between tables must be specified. This is by standing on a field on the left tab and select the relationship field on the right tab.
OUTER When a relationship is created between two tables, you can indicated here whether the data should exist from the selected table (INNER JOIN).

TypeDescription
OUTERRecords from the other tables are retrieved, regardless of whether records are present in this table.
INNERRecords from the other tables are only retrieved when there are records present in this table.
EXCLUDERecords from the other tables are only retrieved when there are no records present in this table.
FieldsThe selected fields from the selected table(s).
NameThe default is the field name of the table, but can be adjusted here. The custom name is shown in the Table or PivotTable.
Method Choice of the calculation on the selected field, there are two types of calculations.

Type 1 grouped the visible or join fields in the table on which a method is applied.

MethodDescription
SUMReturns the summed value from a field in a table.
MINReturns the smallest value from a field in a table.
MAXReturns the largest value from a field in a table.
AVGReturns the average value from a field in a table.
CNTReturns the number of records from a table.

Type 2 only applies to fields of a type date and is intended to reduce the number of records in a PivotTable.

MethodDescription
YearAlways returns “January 1” as date including the year in the field. For example “May 20, 2016” will be changed to “1 January 2016”.
QuarterCalculates the date back to the first day of the quarter (“January 1”, “1 April", “1 July” or "October 1”).
MonthResults in the first day of the month.
WeekReturns the first Monday of the week.
DayDate/time fields will be displayed without the time.
PeriodResults in the first day of the accounting period.
HideCheck this box if the selected field should not be visible on the worksheet. This is useful is the field is used for filtering only.
Table/FieldThis will show the table and field’s original name as it appears in the database. It's possible join table/field will also be shown here.
OpenOpens a EDD (ExSIONAX Download Definition) file.
SaveSaves a EDD (ExSIONAX Download Definition) file.
OKClose the window and create or modify the download definition on your current worksheet.

Continuation on the screen shown above, now with the options from the tab “Settings”:

Field Description
TypeChoose your download type here: TABLE, FORMAT AS TABLE or PIVOT TABLE.
TOPThe maximum number of records to be retrieved.
Sort byThere’s a maximum 3 fields you can use to sort records.
DescendingThere’s a maximum 3 fields you can use to sort records.

To add a table to the download definition, double-click on the table name in the left column (within the list of tables in the “Add” tab). A new row will appear with the name of that table. Click on that row to see the list of fields in the table.

In the following example the table “Customers” with the fields “Customer account” and “Name” and the table “Customer transactions” with the fields “Customer account” and “Amount” with the “SUM” method are added to the download definition. Field “Customer account” is hidden and both tables must contain records (INNER JOIN).

After adding the 2nd table “Customer transactions” comes a join proposal with the table relationships:

Here’s an example of a ready to use download definition after the “OK” button has been clicked.

Field Description
FILTERA filter for the field (See: “Filter usage”).
EXPRESSIEHere, a ExSIONAX function can be used to speed up the download.

When a download definition is used for the first time after clicking the “Refresh data” button, you will be asked where the output from this download should be placed ($A$7). This will be used as the top left cell.

When this is done, the data is retrieved.

Every download definition has a unique name that starts with “ExSIONAX_QUERY_” followed by a number. The output range for this download also has a unique name, this one starts with “ExSIONAX_DATA_” followed by the same number.

When the output range exists, I.E. has data in it, there are settings from Excel itself that you can use. Place your cursor somewhere in this output range and click the right mouse button to access these settings by selecting Properties. This will result in the following window:

Example of Data Range Properties when output type is TABLE:

An example of a download definition of the FORMAT AS TABLE type:

You can access the data properties by placing the cursor somewhere in the table definition and clicking the right mouse button:

This is an example of a download definition to a PIVOTTABLE:

You can access the pivot table properties by placing the cursor somewhere in the pivot table definition and clicking the right mouse button:

Refresh data

With this option, all dynamic downloads and/or formulas recalculated within your Excel document. This option can be used when your data has not been updated in the spreadsheet. The option is similar to the “refresh” of the Internet Explorer.

Reporting library

You can use this function to quick and easily find your created ExSIONAX reports.

First you must add folders that contains your reports to search for:

Once this is done you can search in different folders:

By clicking on the “Open” button, the selected report opens.

Task scheduler

The Task scheduler can be used to have your Excel reports automatically refreshed and mailed or saved at a pre-defined interval.

Click the “Task scheduler” button to see the list of available tasks. The first time it will be empty.

Click the “New” button to add a task.

Field Description
ReportThe name of the report to use as a template.
PathThe pathname where this document is stored.
Save AsThe name of the resulting document. If the same path is used the output document MUST have a different name. Use the PDF extension to have the document stored as a PDF file.
PathThe pathname for the resulting document.
ParameterThe Scheduler can be referring to defined names in the report. When executing the defined name is filled a value (see next paragraph).
ValueThe value to replace in the defined name.
Next >Next screen.

Field Description
E-mailOne or more email addresses to send the document to. Separate addresses with semicolons (;).
SubjectThe email subject.
DescriptionThis text will appear in the email body.

Field Description
Repeat this taskTask frequency.

The following screens depend on the chosen frequency.

Daily

Weekly

Monthly

A task can be changed and/or tested.

Button Description
StartStarts the Task schedular. Excel should not be used at this time and waits for the next scheduled time.
[…]By pressing the ellipsis button behind the various fields, an existing task can be modified. Click on the ellipsis next to “Last error” to execute a selected task immediately.

To remove a task, double-click on the task in the overview window.

Help

Contains all the information needed to use ExSIONAX.

Info

Tab Description
Settings

FieldDescription
LanguageChoice of EN or EN. After changing the language settings are saved per user.
Library pathDeviant directory in which the functions of the Function library are stored.
Number of calculationsHet aantal ExSIONAX berekeningen na het opstarten van Excel.
SupportOur helpdesk can provide remote support using TeamViewer.
Version

FieldDescription
VersieThe ExSIONAX version number.
FeedbackExsion365 B.V. is constantly working to further improve its products. Therefore we collect meta-data about the use of ExSIONAX. With meta data we mean data on the use of reports / Excel sheets. We try to discover trends and patterns. We emphatically do not collect the data of the reports and / or spreadsheets themselves. The manner in which we gather information has no influence on the operation and performance of the system. If you do not want to contribute to this improvement progamme you can change the settings of Exsion, so no meta data is transmitted to us.
ExSIONAXShows the version and Build number of ExSIONAX, the directory where ExSIONAX is installed and informs you if a new version is available.
LicenseShows the company name for which a usage license is granted and a list of users which have activated a license.

General functions

Function Description
ExSIONAX_COMPANYRetrieves the company name for the given Connection ID.
ExSIONAX_DATEThe result of this function can be used to filter Dynamics AX date fields.

The general functions can be found in Excel’s function wizard as category “ExSIONAX General”:

ExSIONAX_COMPANY

The function “ExSIONAX_COMPANY” returns the company name.

Argument Description
IDConnectie ID.

Example: ExSIONAX_COMPANY(1) returns: “Contoso Entertainment USA”.

ExSIONAX_DATE

The functie “ExSIONAX_DATE” returns a value that can be used as a filter for Dynamics AX date fields.

Argument Description
IDConnection ID.
TypePossible values are: Day, Week, Month, Quarter, Year or Accounting Period. These may be abbreviated by their first letter (D, W, M, Q, A).
CumulativeYes, No or YTD (Year To Date).
Index The index must be a number that belongs to the used Type: So if the type is Month the index can be a number from 1 to 12. The number may also be 0 or a negative number. The behavior of the index depends on the used type. Say the current date is October 2015 and the used type is Month. With an index of “-1” this function will return a date filter for September 2015.

TypeChoice
Day1 to 31.
Week1 to 53.
Month1 to 12.
Quarter1 to 4.
YearOffset from.
Accounting Period1 to 13 depending on the amount of periods used.
YearYear (optional, default is current year).

Example: ExSIONAX_DATE(1;"Month";"No";2;"2016") returns: “01-02-16..28-02-16”.

Database functions

The use of database functions is recommended for functions that relate to one Excel sheet only.

These functions don´t need to be stored in the function library.

You can find these functions in Excel´s functions wizard in the category “ExSIONAX Database”:

Field Description
ExSIONAX_DBReturns the (first) value from a field in a table that corresponds to the used filter(s).
ExSIONAX_DBSUMReturns the summed value from a field in a table that corresponds to the used filter(s).
ExSIONAX_DBMINReturns the smallest value from a field in a table that corresponds to the used filter(s).
ExSIONAX_DBMAXReturns the smallest value from a field in a table that corresponds to the used filter(s).
ExSIONAX_DBAVGReturns the average value from a field in a table that corresponds to the used filter(s).
ExSIONAX_DBCNTReturns the number of records from a table that correspond to the used filter(s).

Argument Description
IDConnection ID.
DefinitionA function definition (Range with table name and index) from where the functions gets it’s values (See: Function definition).
FieldThe name of the field from which the value should be returned.
Filter 1Filter for the first field in the function definition (See: Filter usage).
Filter 2Filter for the second field in the function definition.
...Etc...

Function library

The function library holds the User Defined Functions.

These functions act like any other Excel or ExSIONAX function and will be available for all Excel documents.

This library can be shared among all ExSIONAX users.

Filter usage

When you enter a filter, you can use all the numbers and letters that you can normally use in the field. In addition, you can use some special symbols or mathematical expressions.

Here are the available formats:

Symbol Meaning Sample Expression Records Displayed
=Equal to377Number 377.
BLUEThose with the BLUE code, for example, the BLUE warehouse code.
22-1-2016 10:00An exact datetime: 22-jan-2016 10:00:00.
..Interval1100..2100Numbers 1100 through 2100.
..2500Up to and including 2500.
..31-12-2015Dates up to and including 31-dec-2015.
!Either/or1200|1300Those with number 1200 or 1300.
&And<2000&>1000Numbers that are less than 2000 and greater than 1000.
<>Not equal to<>0All numbers except 0.
<>A*Not equal to any texts that start with A.
>Greater than>1200Numbers greater than 1200.
>=Greater than or equal to>=1200Numbers greater than or equal to 1200.
<Less than<1200Numbers less than 1200.
<=Less than or equal to<=1200Numbers less than or equal to 1200.
*An indefinite number of unknown characters*cem*Texts that contain “cem”.
*cemTexts that end with “cem”.
cem*Texts that begin with “cem”.
?One unknown character?imTexts such as Jim of Tim.
()Calculate before rest30|(>=10&<=20)Those with number 30 or with a number from 10 through 20 (the result of the calculation within the parentheses).

You can also combine the various format expressions:

Sample Expression Records Displayed
5999|8100..8490Include any records with the number 5999 or a number from the interval 8100 through 8490.
..1299|1400…Include records with a number less than or equal to 1299 or a number equal to 1400 or greater (all numbers except 1300 through 1399).
>50&<100Include records with numbers that are greater than 50 and less than 100 (numbers 51 through 99).
*C*&*D*Texts containing both C and D.
*co?*Texts containing “co” such as cot, cope and incorporated. “co” must be present, followed by at least one character, but there can be an indefinite number of characters before and after these.

Make sure you use valid filters because it is possible to use an invalid filter without any warning from the database and ExSIONAX passes the filters directly to the database.

VBA Tips and tricks

ExSIONAX offers the abillity to execute user written VBA routines before and after its Refresh function. It is also possible to call ExSIONAX's Refresh function from within a user written routine. Use this carefully because it might effect the Refresh function.

The examples below use ‘ExSIONAX.xlam’. If you use Excel 2003 you should use ‘ExSIONAX.xla’.

Execute menu functions.

Application.Run "'ExSIONAX.xlam'!ExSIONAX_REFRESH"

This will have the same effect as clicking the “Refresh data” button in the ExSIONAX menu.

To be ExSIONAX indepenent you should ignore any errors:

On Local Error Resume Next
Application.Run "'ExSIONAX.xlam'!ExSIONAX_REFRESH"
On Local Error GoTo 0

Call ExSIONAX “Formulas to values”:

Application.Run "'ExSIONAX.xlam'!ExSIONAX_VALUES"

To bypass ExSIONAX message box use the following:

Dim s_displayAlertsSetting As Boolean

s_displayAlertsSetting = Application.DisplayAlerts
Application.DisplayAlerts = False
On Local Error Resume Next
Application.Run "'ExSIONAX.xlam'!ExSIONAX_VALUES"
On Local Error GoTo 0
Application.DisplayAlerts = s_displayAlertsSetting

Before Refresh

Use the following function to execute code before ExSIONAX performs a refresh:

Sub ExSIONAX_BEFOREREFRESH()
	Call [Your own macro]
End Sub

After Refresh

Use the following function to execute code after ExSIONAX performed a refresh:

Sub ExSIONAX_ONREFRESH()
	Call [Your own macro]
End Sub

Example for a Refresh after changing a cell containing a parameter

Place this macro in the ThisWorkbook section.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
	If Target = ActiveSheet.Range("Subcategorie") Then
		Application.Run "'ExSIONAX.xlam'!ExSIONAX_REFRESH"
		ActiveSheet.Calculate
	End If
End Sub

Deactivating ExSIONAX

To deactivate ExSIONAX and free the license you should remove the Exsion add-in from Excel.

Press the “File” button (top left of the screen).

Select “Options”.

Choice “Add-Ins” and press “Go...”.

Uncheck the “ExSIONAX 10.0” addin and press “OK”.

Het ExSIONAX menu is no longer be avalailable and the license is free for another user.