The CISFO:ROWTABLEAREA2 control is used for rendering lists. Have a look at the following example:
The XML form definition is:
<cisfo:foppage2 objectclass="PdfTableAdapter" pageheight="29.7cm" pagewidth="21cm" margintop="1cm" marginbottom="0.5cm" marginleft="1cm" marginright="1cm" headerheight="1.5cm" footerheight="1.3cm"> <cisfo:styleclasses2> <cisfo:style2 stylename="HL" backgroundcolor="#C0C0C0" bordercolor="#000000" borderstyle="solid" borderwidth="0.1mm"> </cisfo:style2> <cisfo:style2 stylename="IL" bordercolor="#000000" borderstyle="solid" borderwidth="0.1mm"> </cisfo:style2> </cisfo:styleclasses2> <cisfo:header2> <cisfo:rowtextblock2 text="Header" textalign="center"> </cisfo:rowtextblock2> </cisfo:header2> <cisfo:footer2> <cisfo:hline2> </cisfo:hline2> <cisfo:vdist2 height="0.3cm"> </cisfo:vdist2> <cisfo:rowtextblock2 text="Page" textalign="center"> <cisfo:pagenumber2 separator=" of "> </cisfo:pagenumber2> </cisfo:rowtextblock2> </cisfo:footer2> <cisfo:body2> <cisfo:rowtablearea2 columnwidths="5cm;9cm;5cm" gridprop="lines"> <cisfo:headline2> <cisfo:row2> <cisfo:celltext2 text="Article" stylename="HL"> </cisfo:celltext2> <cisfo:celltext2 text="Description" stylename="HL"> </cisfo:celltext2> <cisfo:celltext2 text="Price" stylename="HL"> </cisfo:celltext2> </cisfo:row2> </cisfo:headline2> <cisfo:repeat2> <cisfo:row2> <cisfo:replace2 valueprop="atricle" stylename="IL"> </cisfo:replace2> <cisfo:replace2 valueprop="description" stylename="IL"> </cisfo:replace2> <cisfo:replace2 valueprop="price" stylename="IL"> </cisfo:replace2> </cisfo:row2> </cisfo:repeat2> </cisfo:rowtablearea2> </cisfo:body2> </cisfo:foppage2>
Below the ROWTABLEAREA2 control, you see an arrangement of:
CISFO:HEADLINE2 - represents the headline; the headline is repeated on every page of the list.
CISFO: REPEAT2 - represents the part that is repeated as many times as items of the list are available.
The data object representation's class looks as follows:
public class PdfTableAdapter implements IFOPDataObject { // default constructor public PdfTableAdapter() { } public PdfTableAdapter(PDFFOPPreviewOnly previewObject) { for (int i=0; i<50; i++) { LinesItem li = new LinesItem(); li.setAtricle("47" + i); li.setDescription("Article 47" + i); li.setPrice("100,00"); m_lines.add(li); } } // ------------------------------------------------------------------------ // property access // ------------------------------------------------------------------------ // class >LinesItem< public class LinesItem { // property >atricle< String m_atricle; public String getAtricle() { return m_atricle; } public void setAtricle(String value) { m_atricle = value; } // property >description< String m_description; public String getDescription() { return m_description; } public void setDescription(String value) { m_description = value; } // property >price< String m_price; public String getPrice() { return m_price; } public void setPrice(String value) { m_price = value; } } // property >lines< GRIDCollection m_lines = new GRIDCollection(); public GRIDCollection getLines() { return m_lines; } ... ... ... }