final MasterReport report = generator.parseReport(in);
report.getReportConfiguration().setConfigProperty
("org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable", "true");
final PaintComponentTableModel tableModel = new PaintComponentTableModel();
tableModel.addComponent(frame);
report.setDataFactory(new TableDataFactory("default", tableModel));
// Important: The dialog must be modal, so that we know, when the report
// processing is finished.
final PreviewDialog previewDialog = new PreviewDialog(report, this, true);
previewDialog.setToolbarFloatable(true);