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);