How Can I Prevent SSRS query of XML data from Always Returning an Empty Row?

若如初见. 提交于 2019-12-10 16:27:45

问题


I am trying to create a dataset from an XML file in SSRS 2008. Below is a simple piece of XML that shows my problem:

<Company>
</Company>

When using the following as the Query it returns a single row with empty fields for the ID and the Name.

Company{}/People{ID(String), Name(String)}

As you can see there is no <People> element present in the XML and therefore I was expecting it to return an empty dataset (i.e. one with no rows).

Does anyone know of a way to return an empty dataset in these circumstances?


回答1:


Not the answer - but a workaround:

I ended up hiding the spurious row using a visibility expression like:

<Hidden>Len(Fields!ID.Value) > 0 AND Len(Fields!Name.Value) > 0</Hidden>


来源:https://stackoverflow.com/questions/4646588/how-can-i-prevent-ssrs-query-of-xml-data-from-always-returning-an-empty-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!