mmajcica / DeploySsrs

Build-Release task for VSTS/TFS that manages Microsoft's SQL Server Reporting Services
MIT License
21 stars 21 forks source link

Updated the DataSet reference name #1

Closed sqlkabouter closed 6 years ago

sqlkabouter commented 6 years ago

There reference name was pointing to the XML element 'SharedDataSet' instead of the actual name of the DataSet.

mmajcica commented 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.

sebitsi commented 5 years ago

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.