0 Votes

Customized reports

Last modified by Omid Abouali on 2026/09/14 15:29

Previous (Fire Move)    |     Back to Start     |     Next (Batch Processings)

Customized reports with Python

Depending on where you work, your company might want you to export your IDA Tunnel simulation in different formats. In this exercise, you will try out how to customize your reports with Python. In this example, you will use two different Python scripts for custom results export: one for Excel.

This exercise uses files from the examples zip file

Step 1: Results export to Excel

  • First, you need to set up the API. For this, you need to find the file util.py and set the variable path_to_tunnel to point to the bin folder in your IDA Tunnel installation (or another folder if you have IDA Tunnel installed elsewhere):

path_to_tunnel = "C:\\Program Files (x86)\\IDA Tunnel <YOUR IDA VERSION>\\bin\\"  

Note 1: Replace <YOUR IDA VERSION> with your IDA Tunnel version, e.g., 2.0 or 2.1 beta 1.

Note 2: If you use a Windows system, always use double backslashes \\ for specifying paths. 

  • Save the util.py after changing it.
  • Second, you also need to go to Services in Windows and make sure that the IDAMessageBrokerService is running. You can find Services by simply searching it in the Windows search bar.

services_search.png

services_present.png

services_present2.png

  • Now you can either use our provided example_system.IDM or prepare an example system for the report yourself. For the latter, open IDA Tunnel and create a new system1. Log the results you want. Save the system in a suitable location. 
  • Now you can open the script Excel_report.py. Find and set the variable file_path to point to the file example_system.IDM located in the same folder as the Python script.

Note 3: Replace <USER DIR> in the following path with your user directory where the downloaded examples are saved to. 

file_path = "C:\\<USER DIR>\\example\\Customized reports\\example_system.IDM"

  • Define where to save the customized Excel report. Set the variable save_path to point to where you want to save.

save_path = "C:\\<USER DIR>\\example\\Customized reports\\"

  • To run the script, open the command prompt terminal by searching cmd in the Windows search bar.

cmd_search.png

cmd_present.png

  • Then go to IDA Tunnel distributed python directory by typing:

>> cd "C:\\Program Files (x86)\\IDA Tunnel <YOUR IDA VERSION>\\bin\\python"

  • Now you can run the Excel_report.py script by typing:

>> python.exe "C:\\<USER DIR>\\example\\Customized reports\\Excel_report.py"

  • Let the script finish, then go to the folder where you specified the results, and have a look at output1.xlsx (which contains raw data) & output2.xlsx (which contains extra data extracted/added).
  • The names “RESULTS” and “Path Report” in the Excel_report.py are the default names of the logged files in the Results window of the example_system.IDM. You need to change them if different names are used in your system model.
  • Try out the same method on another system if you want! 
  • Is there more data that you want to export to Excel? Then, have a look at the Excel_report.py and modify it accordingly.

Previous (Fire Move)     |     Back to Start    |     Next (Batch Processings)