File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Header, Footer with dynamic data

 
Raja Pam
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to display dynamic header, dynamic footer, with dynamic data in column.
I tried with following code:

<rich:dataTable id="report" value="#{viewClass.resultList}" var="list">
<f:facet name="header">
<rich:columnGroup>
<rich:column>
<a4j:commandLink value="Header1" actionListener="#{viewClass.sortTable}"/>
</rich:column>
<rich:column>
<hutputText value="Header2" />
</rich:column>
<rich:column>
<hutputText value="Header3" />
</rich:column>
<rich:column>
<hutputText value="Header4" />
</rich:column>
<rich:column>
<hutputText value="Header5" />
</rich:column>
<rich:column>
<hutputText value="Header6" />
</rich:column>

</f:facet>
<rich:subTable value="#{viewClass.resultList}" var="item1" >
<rich:column>
<hutputText value="#{item1.header1}"></hutputText>
</rich:column>

<rich:column>
<hutputText value="#{item1.header2}"></hutputText>
</rich:column>

<rich:column>
<hutputText value="#{item1.header3}"></hutputText>
</rich:column>

<rich:column>
<hutputText value="#{item1.header4}"></hutputText>
</rich:column>

<rich:column>
<hutputText value="#{item1.header5}"></hutputText>
</rich:column>

<rich:column>
<hutputText value="#{item1.header6}"></hutputText>
</rich:column>
</rich:subTable>

<f:facet name="footer">
<rich:columnGroup>
<rich:column>
<rich:spacer></rich:spacer>
</rich:column>
<rich:column rowspan = 2>Totals</rich:column>
<rich:column>
<hutputText value="#{viewClass.tot1}"></hutputText>
</rich:column>
<rich:column>
<hutputText value="#{viewClass.tot2}"></hutputText>
</rich:column>
<rich:column>
<hutputText value="#{viewClass.tot3}"></hutputText>
</rich:column>
<rich:column>
<hutputText value="#{viewClass.tot4}"></hutputText>
</rich:column>
</rich:columnGroup>
</f:facet>

</rich:dataTable>

But Output is coming as :

Header1 Header2 Header3 Header4 Header5 Header6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
Total 12 23 45 22

Same data got repeated 3 times for 3 sets of records, 4 times for 4 sets of record i.e n times for n set of records..

Someone Please please please respond and help.


 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your headers and data should be in the same column, not separated.
 
Raja Pam
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot...

Done in the same way... Issue is resolved...

Thanks you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic