Tuesday, 9 December 2014

Rendering SSRS reports in XML



I'm trying to create an SSRS report that can be rendering in XML format, so that the web developers can use the data, add their own styling, etc.


The purpose of this is so that I can create different reports for different campaigns quickly, and not require too much interaction with the rest of the developers.


So I should be able change the number of columns, title headers, add in a row with the Total, etc.


I created a report and tested.


The report included a table with header row, few lines of data, and a row at the bottom with the word 'Total', and the total of one of the columns.


However, below is the XML that was created. It doesn't include the header row, or the word Total. And the field showing the value of the total is given the arbitrary name of Textbox39.


How can we do this, so that the output of the report is more useful and more generic?


Alternatively, if we used HTML4.0 or MHTML instead would they be able to control the styles, etc?


(Note that I'm using Report Builder 3.0.)



<?xml version="1.0" encoding="UTF-8"?>

-<Report xmlns="TicketTracker" xmlns:xsi="http://ift.tt/ra1lAU" Name="TicketTracker" xsi:schemaLocation="TicketTracker http://ift.tt/163sPTt">


-<Tablix3>

<Textbox31/>


-<Tier_Collection>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="0" CountDeposits="0" Tickets="50" DisplayText="1000-"/>

</DisplayText_Collection>

</Tier>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="0" CountDeposits="0" Tickets="25" DisplayText="500-999.99"/>

</DisplayText_Collection>

</Tier>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="70" CountDeposits="7" Tickets="10" DisplayText="200-499.99"/>

</DisplayText_Collection>

</Tier>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="18" CountDeposits="6" Tickets="3" DisplayText="100-199.99"/>

</DisplayText_Collection>

</Tier>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="2" CountDeposits="2" Tickets="1" DisplayText="50-99.99"/>

</DisplayText_Collection>

</Tier>


-<Tier>


-<DisplayText_Collection>

<DisplayText TotalTickets="0" CountDeposits="0" Tickets="0" DisplayText="0-49.99"/>

</DisplayText_Collection>

</Tier>

</Tier_Collection>

<Textbox36 Textbox39="90"/>

</Tablix3>

</Report>

No comments:

Post a Comment