I noticed this behavior when importing reports and a viewer screen vision window from a 7.9.12 project into an 8.1.1 project. It appears that the ‘Text’ column value is concatenated into the ‘Path’ value, such that if the results are pulled into a tree view component, each report item actually appears like a folder, with a copy of itself (with an improperly extended/duplicated path) as the underlying node.
In the 7.9.12 project, I have the following structure of reports:
Then on the reporting viewer window, the root container has this custom method, which the tree view .items property is bound to:
## Get all the configured reports as a dataset
dataset = system.report.getReportNamesAsDataset('Line_Integration')
## Build a new dataset using the dataset headers, but only keep reports in the 'Production/' folder
data = system.dataset.toPyDataSet(dataset)
headers = system.dataset.getColumnHeaders(dataset)
rows = []
for row in data:
rowData = []
if row['Path'].startswith('Production/'):
for header in headers:
rowData.append(row[header])
rows.append(rowData)
reportDataset = system.dataset.toDataSet(headers, rows)
return reportDataset
And the resulting tree view looks as it should:
But in the 8.1.1 project, the same window and bindings come up like this:
This causes the report viewer, which I have bound to the selectedPath of the tree view, to not work properly.
I’ve managed to work around this for now by manually stripping the report name (‘Text’) from the end of the path
for row in data:
path = row['Path']
if path.endswith(row['Text']):
path = path.replace(row['Text'], "")
I’ve tested with a different project running on 8.0.14 and I get the same behavior. I haven’t tested with any other versions.