ReportContext context = new ReportContext();
context.define("items", items);
PdfGenerator.generatePdf(context, report, new File("out4.pdf"));
PageStore pageStore = new PageStore();
FontRenderContext frc = new FontRenderContext(null, true, true);
Formatter fmt = new Formatter(report, context, frc, pageStore);
long tm = System.currentTimeMillis();
tm = System.currentTimeMillis()-tm;
System.out.println("Time for formatting: " + tm + "ms");
PreviewDialog frame = new PreviewDialog(null, fmt, pageStore);
frame.setTitle("Print preview");