mmajcica / DeploySsrs

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

Wrong property used for getting SharedDataSetReference name #28

Closed sqlkabouter closed 4 years ago

sqlkabouter 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.

Originally posted by @sebitsi in https://github.com/mmajcica/DeploySsrs/pull/1#issuecomment-478506437

mmajcica commented 5 years ago

Hi @sqlkabouter ,

I'm not in the position right now to test any of this. If you think that there is a bug, feel free to make a fix, test it and submit a PR. As soon there, I'll merge the changes and push a new version of the extension.

Any contribution is welcome.