*
* @return the page header.
*/
private PageHeader createPageHeader()
{
final PageHeader header = new PageHeader();
header.setName("Page-header");
header.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(18));
header.getStyle().setStyleProperty(TextStyleKeys.FONT, "Dialog");
header.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_COLOR, new Color(0xafafaf));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_COLOR, new Color(0xafafaf));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_COLOR, new Color(0xafafaf));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_COLOR, new Color(0xafafaf));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH, new Float(1));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_WIDTH, new Float(1));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_WIDTH, new Float(1));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_WIDTH, new Float(1));
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, BorderStyle.SOLID);
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE, BorderStyle.SOLID);
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, BorderStyle.SOLID);
header.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE, BorderStyle.SOLID);
header.setDisplayOnFirstPage(true);
header.setDisplayOnLastPage(false);
final DateFieldElementFactory factory = new DateFieldElementFactory();
factory.setName("Date");
factory.setAbsolutePosition(new Point2D.Float(0, 0));
factory.setMinimumSize(new FloatDimension(-100, 14));
factory.setHorizontalAlignment(ElementAlignment.RIGHT);
factory.setVerticalAlignment(ElementAlignment.MIDDLE);
factory.setNullString("<null>");
factory.setFormatString("d-MMM-yyyy");
factory.setFieldname("report.date");
header.addElement(factory.createElement());
final Element line = HorizontalLineElementFactory.createHorizontalLine(16);
line.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(2));
line.getStyle().setStyleProperty(ElementStyleKeys.PAINT, Color.decode("#CFCFCF"));
header.addElement(line);
return header;
}