// that says 'Respondent: <name>'. The whole string can be centered on the page that way.
// This expression expects to find a marked report property called 'MANAGER_NAME', look
// in the attemptPreview() method to see how this is set up.
// here is the element that displays the string calculated in the expression above.
final MessageFieldElementFactory tfef = new MessageFieldElementFactory();
tfef.setFormatString("Respondent: $(RESPONDENT_NAME)");
tfef.setFontName("SansSerif");
tfef.setFontSize(new Integer(12));
tfef.setBold(Boolean.TRUE);
tfef.setAbsolutePosition(new Point2D.Double(0.0, 38.0));
tfef.setMinimumSize(new FloatDimension(PRINT_WIDTH, 14.0f));
tfef.setHorizontalAlignment(ElementAlignment.CENTER);
pageHeader.addElement(tfef.createElement());
labelFactory.setAbsolutePosition(new Point2D.Double(X1, 58.0));
labelFactory.setText(
"Please note that the questions AND responses presented below were INVENTED for the the purpose of this demo report. They are NOT real.");
labelFactory.setFontName("Serif");