final MasterReport report = new MasterReport();
final StaticDataFactory staticDataFactory = new StaticDataFactory();
report.setDataFactory(staticDataFactory);
report.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createMainTableModel()");
final Element textElement = TextFieldElementFactory.createStringElement("reportField1", new Rectangle(0, 0, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "c1");
report.getItemBand().addElement(textElement);
final SubReport subReport = new SubReport();
subReport.addInputParameter("c1", "c1");
subReport.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createSubReportTableModel(c1)");
final Element subReportTextElement = TextFieldElementFactory.createStringElement("subreportField1", new Rectangle(20, 0, 100, 20), Color.RED, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t1");
subReport.getItemBand().addElement(subReportTextElement);
report.getItemBand().addSubReport(subReport);
final Element textElementT1 = TextFieldElementFactory.createStringElement("reportFieldT1", new Rectangle(0, 20, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t2");
report.getItemBand().addElement(textElementT1);
final ParameterMapping[] parameterMappings = subReport.getExportMappings();
for (int i = 0; i < parameterMappings.length; i++)