undo.addChange(Messages.getString("CrosstabReportElementDragHandler.UndoEntry"),
new ElementEditUndoEntry(parent.getObjectID(), parent.getElementCount(), null, subReport));
parent.addElement(subReport);
}
final ReportDesignerContext designerContext = dragContext.getDesignerContext();
final Window window = LibSwingUtil.getWindowAncestor(designerContext.getView().getParent());
final AbstractReportDefinition reportDefinition = designerContext.getActiveContext().getReportDefinition();
try
{
// Create the new subreport tab - this is where the contents of the Crosstab
// dialog will go. Zoom the crosstab canvas to 150% as crosstab has a lot of elements to display
subReport.setDataFactory(reportDefinition.getDataFactory());
subReport.getReportDefinition().setAttribute(ReportDesignerBoot.DESIGNER_NAMESPACE, ReportDesignerBoot.ZOOM, 1.5f);
final int idx = designerContext.addSubReport(designerContext.getActiveContext(), subReport);
designerContext.setActiveDocument(designerContext.getReportRenderContext(idx));
}
catch (ReportDataFactoryException e)
{
UncaughtExceptionsModel.getInstance().addException(e);
}