How to display empty attributes in SSRS when exporting XML with report data

I am exporting XML SSRS reports for someone, and we are faced with a situation where the XML rendering table contains an element for each instance of the Details row, but where any cell is empty, this attribute is not added to the element.

I would rather use ATOM data output instead, as it is much more reliable, however they are not inclined to use XML output.

Output Example:

<Details DateStamp="2012-01-01" Customers="56703" Sales="624" />
<Details DateStamp="2012-02-01" />
<Details DateStamp="2012-03-01" Customers="107271" Sales="3195" />

Does anyone know of any way to make display attributes display, even if they don't matter? Or is this not possible in XML format?

Ideally, something like:

<Details DateStamp="2012-01-01" Customers="56703" Sales="624" />
<Details DateStamp="2012-02-01" Customer="" Sales="" />
<Details DateStamp="2012-03-01" Customers="107271" Sales="3195" />

Try this sample query for a DataSet:

 SELECT
    '2012-01-01' as [DateStamp]
    ,56703 as [Customers]
    ,624 as [Sales]

UNION ALL

SELECT
    '2012-02-01' as [DateStamp]
    ,NULL as [Customers]
    ,NULL as [Sales]

UNION ALL

SELECT
    '2012-03-01' as [DateStamp]
    ,107271 as [Customers]
    ,3195 as [Sales]
+3
source share
1 answer

Details "DataElementOutput" "Output". ( , .)

SSRS

, NULL ISNULL ([ColName], 0) ISNULL ([ColName], '') DataElementOutput = Output, xml. , NULL , .

+2

All Articles