MPRGTable.uispin.html
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<ui:call ui:template="{= ?template }" arg:report="{= ?report }">
<ui:if ui:condition="{= spr:rowCount(?rs) > 0 }">
<div>
<hr />
<ui:setContext ui:queryGraph="<http://www.reportinghub.no/ep/spin/mpr-tables>">
<h2>{= ui:label(?template) }</h2>
</ui:setContext>
<table class="ddrTable" letrs:hrs="{#
SELECT ?header ?left
WHERE {
GRAPH <http://www.reportinghub.no/ep/spin/mpr-tables> {
?template rhspin:tableHeaders ?list .
?list <http://jena.hpl.hp.com/ARQ/list#member> ?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, ' ', ' ')) }" /></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>