David Price

Copied MPRG over for DPR to get column alignment and ignore empty tables.

<div>
<hr />
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/dpr-tables&gt;">
<h2>{= ui:label(?template) }</h2>
</ui:setContext>
<table class="ddrTable">
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/dpr-tables&gt;">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{#
SELECT ?header
WHERE {
?template rhspin:tableHeaders ?list .
?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?header .
}
}">
<th class="ddrTH">{= ?header }</th>
</ui:forEach>
</tr>
</ui:setContext>
<ui:call ui:template="{= ?template }" arg:report="{= ?report }">
<ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{# SELECT ?cell WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?cellIndex) } }">
<td class="ddrTD">{= ui:label(?cell) }</td>
</ui:forEach>
</tr>
</ui:forEach>
</ui:call>
</table>
<br />
</div>
\ No newline at end of file
<ui:call ui:template="{= ?template }" arg:report="{= ?report }">
<ui:if ui:condition="{= spr:rowCount(?rs) &gt; 0 }">
<div>
<hr />
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/dpr-tables&gt;">
<h2>{= ui:label(?template) }</h2>
</ui:setContext>
<table class="ddrTable" letrs:hrs="{#
SELECT ?header ?left
WHERE {
GRAPH &lt;http://www.reportinghub.no/ep/spin/dpr-tables&gt; {
?template rhspin:tableHeaders ?list .
?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?str .
BIND (fn:starts-with(?str, '*') AS ?left) .
BIND (IF(?left, fn:substring(?str, 2), ?str) AS ?header) .
}
}
}">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{= ?hrs }">
<th class="ddrTH" style="text-align: {= IF(?left, 'left', 'center') }"
><ui:parse ui:str="{= html:encodeBRs(spif:replaceAll(?header, ' ', '&nbsp;')) }" /></th>
</ui:forEach>
</tr>
<ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{# SELECT ?cell ?colIndex WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?colIndex) } }">
<!--td class="ddrTD" style="text-align: {= IF(spr:cell(?hrs, ?colIndex, 1), 'left', 'center') }"-->
<td class="ddrTD">{= ?cell }</td>
</ui:forEach>
</tr>
</ui:forEach>
</table>
<br />
</div>
</ui:if>
</ui:call>
\ No newline at end of file
......