You can automate it a bit using nxshell (which is python internally) – generate CSV or xlsx file.
However, if you want fully automated reports – you need to use some kind of reporting engine, either built-in Jasper or some external solution.
Sample script which export summary table into csv file:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv, sys
menuPath = "Table1" # Table's "Menu Path"
baseObjectId = 2 # Infrastructure Services
outputFile = 'test.csv'
for table in session.listDciSummaryTables():
if table.getMenuPath() == menuPath:
result = session.queryDciSummaryTable(table.getId(), baseObjectId)
if result:
with open(outputFile, 'w') as f:
w = csv.writer(f, dialect='excel')
columns = []
for c in result.getColumns():
columns.append(c.getDisplayName())
w.writerow(columns) # Header
for row in result.getAllRows():
cells = []
for i in range(0, row.size()):
cells.append(row.get(i).getValue())
w.writerow(cells)