Reports in Spreadsheet

How to create a Spreadsheet report using an iTop query

Getting data from iTop

Administrators can store predefined queries in iTop (menu “Administration / Query Phrasebook”). These queries can then be used to create reports in Excel. A query is identified by a number. It is called in Excel using a URL provided by your iTop administrator. For example, the URL below stored in the query phrasebook, returns a list of User Request:

Then, you can use this URL query with your favorite spreadsheet application :

Currently, the only fully functional spreadsheet solution is Microsoft Excel.

Reports in Excel

Recent versions of Excel (Excel 2016, Office 365) provide two methods for importing Web Data into Excel. The most recent version activates by default PowerQuery and does not support Basic Authentication, it only works with Token. To get things even more confusing, both mode are using menu items that have exactly the same label!
Excel is not compatible with TLS1.3. Your iTop webserver must also be compatible with TLS1.2

There are 2 modes to automatically extract data from iTop to Excel: Basic authentication also know as legacy Query from Web and Power Query Builder

Query from Web Power Query Builder
login Basic authentication with login/pwd Token
User iTop iTop Local User User Token (with any type of iTop User) or Application Token
Query variables supported Yes No
Support multi-lines (text & HTML) fields Yes No
export-v2 supported formats csv, spreasheet, html csv only
Security on credentials login/password does not have to be stored in the sheet Token is automatically stored in clear text in the file
Do not share excel file using Power Query Builder as they include your token in clear text, so allow to steal your iTop privilege
Migration from one mode to another is tricky and may impact your reports if you compute values based on the data extracted from iTop (Pivot Table, mathematical computation ….)
See migrating section below for more details.
This will have to me done if you activate Multi Factor Authentication for your iTop users

Legacy Query from Web

Prerequisite

  • Web Server must authorize basic authentication
  • iTop login_mode contain basic
  • User must be an “iTop local User” (and MFA not configured for this User)

Activate this mode

Click on the menu item “Data” / “From Web”. If you get a dialog similar to the one below (PowerQuery) this is not good.

Excel GetPowerQueryDataFromWeb wizard

Instead you should get a dialog similar to this:

Excel GetExternalDataFromWeb wizard

To use the old GetExternalDataFromWeb wizard, follow these steps:

Go to the File / Options menu

Click on the “Customize Ribbon” menu on the left:

In the drop-down list at the top-left, select “Main tabs”, in the tree displayed, open the item “Data” and select the menu item “From Web”

Since the old and the new menus have exactly the same label, make sure that you select the right one: let your mouse over the item ; a small tooltip is displayed, it should read “GetExternalDataFromWeb” and not “GetPowerQueryDataFromWeb”

GetExternalDataFromWeb

To add the command to your Ribbon you must create a new “Group” (using the button at the bottom of the dialog box). The group is named with a default name, but you can rename it if you like:

New group

Similarly, you can rename the menu and choose an icon for it. Once your menu has been added to the ribbon, you should see something similar to this:

When you click on the custom menu, the “External Data From Web” wizard should appear:

Build a report

To use this query in Excel, click on the button From Web in the Excel tab Data

A window is displayed to enter the URL to be called:

Enter the URL provided by the iTop administrator in the Address part and click on Go.

The iTop authentication window is displayed. Enter your user account and your password:

Click on Ok: if you are prompt by security popup windows.

The New Web Query is updated with the list of columns to be imported:

Click the Import button. Excel asks you where you want to insert the data:

If your query contains parameters, Excel will open several successive windows to enter them. Be careful, date parameters only support the format yyyy-mm-dd.

Click the OK button and Excel displays the result of the query. The language used for the display of columns corresponds to the default language of your login in iTop.

To refresh the data, click on the Refresh All button in the Data tab of Excel:

You can use as many iTop queries as you want and use the results to create graphs or charts dynamically using standard Excel features.

With Power Query Builder

Prerequisite

  • login_mode token must be enabled
  • A User Token or an Application Token
To use personal token please refer first to Authentication by Token

Build a report

Let's assume you have created a Web Query in iTop, which can be called with this URL

http://localhost/itop/webservices/export-v2.php?format=csv&login_mode=token&query=109
format must be csv.
Cautious html, spreadsheet are not working with token.
csv only works with simple fields with single line data.

Open Excel, and import with the new wizard mode

 New wizard menu

Let's assume that you have created a Personal Token in iTop and have copied the token.

In the new Wizard pop-up window:
a. Select Advanced (default mode is Basic)
b. In the field URL parts enter:
http://localhost/itop/webservices/export-v2.php?format=spreadsheet&login_mode=token&query=109
c. In the field HTTP request header parameters (optional)
- Type Auth-Token (and not auth_token)
- Paste the Token value from iTop.
d. Press Ok button,
Existing Token values cannot be retrieved in iTop, if forgotten, a new Token must be created and all your queries using the old Token must be changed

In the new pop-up window with Navigator

1. Click on the Table 2. Press Load button 3. Get the result in Excel sheet

Migrating to Power Query Builder

This procedure has to be done if you activate security rules such as Multi Factor Authentication configuration or usage of SSO in iTop
This may take time based on your reports complexity and the number of reports to rework

Existing spreadsheets will have to be reworked

  • For each spreadsheets recreate a corresponding Power Query using csv format in url, this will create automatically a new sheet so your pivot tables and computation will have to be updated
  • Variables are not more usable, so you will have to create multiple QueryPhrases in iTop
  • Multi-lines data can no more be exported (as only csv format is supported by Query Builder)

Reports in LibreOffice

This section is based on the LibreOffice reference documentation. You can also watch this howto youtube video in French.

The software's default configuration is compatible with iTop: there's nothing to change.

To use an iTop query in LibreOffice Calc, select the cell where you want to insert the data. Then, click on the menu Sheet > External links… or the button External links in the tab Data

Calc overwrites the data in columns after the selected cell and does not shift their data. LibreOffice Calc does not support this data import option. Make sure you have as many empty columns as fields imported.

External links Menu in standard UI External links Menu in tab UI

The External data window is displayed to enter the URL to be called:

External data window

Enter the URL provided by the iTop administrator in the URL of External Data Source part and press the Enter key on your keyboard.

The iTop authentication window is displayed. Enter your user account and your password:

Login window to the iTop user

You can then adjust the import options. If you don't have special needs, the defaults are ok:

Import options window

The Available Tables/Ranges is updated with the list of tables to be imported. To get just one table, select HTML_1 :

External data window with table choices

If your query contains parameters with variable :var, LibreOffice Calc will not prompt you to get these and only show the table's headers.

Click the OK button and LibreOffice Calc displays the result of the query. The language used for the display of columns corresponds to the default language of your login in iTop.

To refresh the data, click on the menu Edit > Links to External files…, and then the Update button on the Edit Links window.

Menu Edit > Links to External files... Edit Links window

You can use as many iTop queries as you want and use the results to create graphs or charts dynamically using standard LibreOffice Calc features.

Reports in WPS Office

Please, follow the howto on the WPS Office editor's web site.

To use an iTop query in WPS Office, go to the Data tab, then click on the button Import Data > From Web….

To update an iTop query in WPS Office, go to the Data tab, then click on the button Refresh All.

WPS Office webquery menu

Reports in OnlyOffice

It seems that OnlyOffice do not support web queries. You can go to the reference documentation on the editor's website, to check if there are changes in newer versions.

Q&As

Why are values starting with a single quote?

Due to a security fix, since iTop 3.2.3 / 3.3.0 values are prefixed with a single quote to avoid CSV injection vulnerability. This can break some existing spreadsheets, if you trust the imported data and want to disable this protection, you can add &ignore_excel_sanitization=1 to the export URL.

latest/user/excel_report.txt · Last modified: 2026/04/24 15:34 by 127.0.0.1
Back to top
Contact us