Microsoft Excel Calculation
Microsoft Excel Calculation leverages Microsoft Excel spreadsheets to perform complex calculations. This allows business users to easily separate the UI from the logic.
Installation Requirements
Before installing this extension you must consider the following requirements:
-
You must have administrator/elevated permissions to the Infiniti web server, including the ability to copy and replace files in the Infiniti installation folder. This is usually
c:\inetpub\wwwroot\infiniti
however may vary from system to system. -
You must have the following installation files:
-
MicrosoftExcelForCalculations.dll
-
Ensure you have a compatible version of the connector with your current Infiniti system (Connector and Infiniti should match versions)
-
Ensure you have an active license for the connector.
Remember
Changes to the configuration may cause interruptions to users in forms.
Before installing this Connector in a production Infiniti environment, ensure the environment is backed up.
It is recommended that this installation is tested in a non-production environment first, and installed during scheduled downtime.
Installation and Configuration
Use the instructions below to install the connector. If you are upgrading the extension from a previous version, refer to the section Upgrading the Connector.
Note that [Infiniti Produce Path]
refers to the installation path on the webserver running Infiniti, where the Produce site has been installed. By default this is c:\inetpub\wwwroot\infiniti\produce
however may vary from environment to environment. Equally, [Infiniti Manage Path]
refers to where the Manage site has been installed, and [IntelledoxScheduler Path]
refers to where the Scheduler service has been installed.
How to install the Connector
- Copy the file listed above into the following folder on the Infiniti web server:
[Infiniti Produce Path]\bin
- Using a text editor such as Notepad, open the following file:
[Infiniti Produce Path]\appsettings.json
Note
Ensure you have elevated privileges when opening the
appsettings.json
file, otherwise you may not be able to save in the current folder.
- Locate the
<Extensions>
section of theappsettings.json
file and add the following entries:
"MicrosoftExcelForCalculations.MicrosoftExcelCalculationDatasource, MicrosoftExcelForCalculations"
A similar process has to be done in Manage.
- Copy the file listed above into the following folder on the Infiniti web server:
[Infiniti Manage Path]\bin
- Using a text editor such as Notepad, open the following file:
[Infiniti Manage Path]\appsettings.json
"MicrosoftExcelForCalculations.MicrosoftExcelCalculationDatasource, MicrosoftExcelForCalculations"
Using a web browser, navigate to the Infiniti Produce and Infiniti Manage applications to allow the system to register the Connector.
Installation to Infiniti Scheduler
If the target environment is using the Scheduler, it is best practice to always install connectors and accelerators to this service at the same time as the installation in Infiniti Produce application. If this is not installed to the Scheduler there may be errors if any projects are executed from the scheduler that refers to this connector.
To install any connector to the Scheduler, follow the instructions in this guide as they apply to Infiniti Produce, except instead of [Infiniti Produce Path] use [IntelledoxScheduler Path], noting that there is no ‘bin’ folder in this path so all files should be copied into the root of this path. For example, consider the path:
c:\inetpub\wwwroot\infiniti\produce\bin
To install to the Scheduler, simply use this path:
c:\inetpub\wwwroot\infiniti\intelledoxscheduler
Also, you must apply the same configuration changes as instructed for the Produce appsettings.json
file.
Datasource Configuration
To configure the connector you will need a Microsoft Excel spreadsheet to be used as a data source, where filter fields are those cells used in your formulas and display fields the actual results.
For this article let's use the following spreadsheet as an example:
A spreadsheet that calculates future value of a particular investment which has constant interest rate and periodic payments, where:
- rate: Interest rate/period.
- nper: Number of periods.
- pmt: Payment/period.
- pv: Present value.
- type: when payment is made, for this example at the end of the period.
- Navigate to Data Connections in Manage and click New Data Connection.
- Provide a Data Connection Name.
- Change Connection Type to Microsoft Excel Calculation.
- Upload the spreadsheet as a Schema.
- Provide a valid Connection Attributes, the following keywords are accepted:
filterFields
,displayFields
, optionallydebug
for debugging purposes. For our example:
filterFields=B2,B3,B4,B5,B6;displayFields=B7;debug=true
All Filter Fields values must be provided. Null values will break the execution. If debug is enabled the input and output cells will be logged to EventLog table.
6. Click Test Connection, you should get Connection Successful.
7. Click Save.
Tip
It is recommended to enable Export Connection Attributes as it will include the connection attributes in exported projects.
- Click Data Objects > New Data Object.
- Data Object Name / Definition: In a simple scenario like our example a simple name like "FutureValue" is enough. For more complex spreadsheets with several sheets, you can optionally define which
Sheet
and display fields to be applied per Data Object.- Specific Filter Fields can be included using Add Custom.
- If
sheet
is not defined the first sheet will be used for references not specifying a sheet. - To reference other sheets per cell use the typical Excel format of
SheetName!A1
. cells
is used to define the outputs from the Excel spreadsheet. For example,cells=A1,A2
means A1 and A2 will be returned as display fields.
sheet=Sheet1
sheet=Sheet1;cells=A2,A4,A5
Cells Types
The Input Cells should have the correct data types for what they are expecting. Thus if a cell expects number, its data type category should be Number. Scientific cells are treated like Numbers. The same for date cells.
- Click Save.
Tip
It is recommended to change the Display Name of Filter and Display Fields, otherwise, they will appear in Design as Cell Names like
B4
Datasource Usage
Microsoft Excel Calculation Datasource can now be used as any other Datasource, where Filter Fields behave as the spreadsheet inputs and the Display Fields will return calculated values. Here a screenshot that shows a Project that leverages the recently created Future Value Datasource.
Note that all Filter Fields are implemented using All Of
, calling the Datasource only when all inputs are provided. Datasource Answer points to value returned by Future Value formula. Here a screenshot in Produce:
To download this sample Project, Click Here
Updated about 5 years ago