private void writePageDefinition() throws IOException
{
final XmlWriter xmlWriter = getXmlWriter();
final PageDefinition pageDefinition = getReport().getPageDefinition();
if (pageDefinition instanceof SimplePageDefinition)
{
final SimplePageDefinition spdef = (SimplePageDefinition) pageDefinition;
final AttributeList attr = new AttributeList();
attr.setAttribute(ExtParserModule.NAMESPACE, "width",
String.valueOf(spdef.getPageCountHorizontal()));
attr.setAttribute(ExtParserModule.NAMESPACE, "height",
String.valueOf(spdef.getPageCountVertical()));
xmlWriter.writeTag(ExtParserModule.NAMESPACE,
ReportConfigWriter.SIMPLE_PAGE_DEFINITION_TAG, attr, XmlWriterSupport.OPEN);
final AttributeList attributes = buildPageFormatProperties(spdef.getPageFormat(0));
xmlWriter.writeTag(ExtParserModule.NAMESPACE,
ReportConfigWriter.PAGE_TAG, attributes, XmlWriterSupport.CLOSE);
xmlWriter.writeCloseTag();
}
else
{
xmlWriter.writeTag(ExtParserModule.NAMESPACE,
ReportConfigWriter.PAGE_DEFINITION_TAG, XmlWriterSupport.OPEN);
final int max = pageDefinition.getPageCount();
for (int i = 0; i < max; i++)
{
final PageFormat fmt = pageDefinition.getPageFormat(i);
final AttributeList attributes = buildPageFormatProperties(fmt);
xmlWriter.writeTag(ExtParserModule.NAMESPACE, ReportConfigWriter.PAGE_TAG,
attributes, XmlWriterSupport.CLOSE);
}