Closed sqlkabouter closed 6 years ago
Datasets are the only thing I added but I was not able to test them. I am confident that your change is genuine. I'll merge this and publish a new version.
Thank you for your contribution.
Hi @mmajcica and @sqlkabouter.
I think there is bug in concept how shared datasets are referenced.
Look into this part of code (lines 954+):
If ($ReferenceDataSets -and $DataSets) {
$nodes = $Definition.SelectNodes('d:Report/d:DataSets/d:DataSet/d:SharedDataSet/d:SharedDataSetReference/..', $NsMgr)
foreach($node in $nodes)
{
@($Datasets | Where-Object { $_.Name -eq $node.ParentNode.Name }) | ForEach-Object { $node.SharedDataSetReference = $_.Path }
}
}
In this code dataset's name defined in config file is compared to node.ParentNode.Name. In si not correct because ParentNode.Name is name of report's datatable not shared datatable. Shared datatable's name is inside $node.
If report's datatable has reference to shared datatable with same name there is no problem. But if names are different, task will not match it.
There reference name was pointing to the XML element 'SharedDataSet' instead of the actual name of the DataSet.