Adroit supports excel reporting via a publishexcel.bas script file. This file can be found in the Adroit Additional Components install.
Here are the steps:
1.Copy the script file to your Project Folder\Script\ folder.
2.Now we go to Excel and create the report.
In the cells you want to display the values from Adroit, type in Adroit.{tagname}.{slot}. In the example above I used the SystemInfo agent and the second, minute and hour slots. Save this file as an .xls to any location. Make sure you remember the filename and location you saved it in. You will need it later.
3.Now go to your Agent Configurator and create a script agent. In the Modules window, select the publishexcel.bas file. Make sure to untick the “Exclude path from file name”.
In the Main Subroutine click on the browse button next to the textbox. Now you should see different functions available from this script. We are going to use the “AdrProduceExcelReport” function.
It should look like this now:
4.The next step is to specify the excel report file and what functions you want from it. This will be true or false commands specified after the excel file. It is represented with comma’s after the filename with either 1 or 0. See example later.
'AppVisible : True if you want the Excel application window to be visible to the user
'ReadOnly : True if you want the Excel worksheet file specified in the XLSfile parameter to open in read-only mode
'PrintXLSfile : True if you want to print the Excel worksheet
'CloseWhenFinished : True if you want to close the worksheet when this script has finished
Here is the example command.
AdrProduceExcelReport C:\ProgramData\Adroit Technologies\Adroit\Configurations\1MAPS Project\Script\Excel Sample Report.xls,1,0,0,0
C:\ProgramData\Adroit Technologies\Adroit\Configurations\1MAPS Project\Script\Excel Sample Report.xls - is the filename and location.
,1 - AppVisible. I want to see that Excel opens with the values in it.
,0 - ReadOnly. I don’t want the file to be a Read Only.
,0 - PrintXLSfile. I don’t want the Excel to be printed automatically to my default printer.
,0 - CloseWhenFinished. I don’t want the Excel file to close automatically after populating with values and/or after printing it.
5.Click the Update button on the right of the window. Now you can run the script. Click on the button next to the Main Subroutine textbox. The excel file will now open and populate the cells you specified with Adroit tags.
6.You can now select to trigger the script either from a tag or every xx seconds.