|| subreportTable.getSelectedColumn() != SubReportTableModel.COL_DEFAULTCHOICE) {
return;
}
ItemSelectorEditable<QueryExecuterSub> subreports = reportQuery.getSubReports();
QueryExecuterSub subreport = subreports.get(subreportTable.getSelectedRow());
try {
Report report = queryManager.get(subreport.getReportId());
Object res = report.execute();
ReportExecuteDialog dlg = new ReportExecuteDialog(parent);
while (res instanceof UserInputChunk) {
UserInputChunk chunk = (UserInputChunk) res;
dlg.addPanel(new UserInputPanel(chunk));
dlg.setVisible(true);
if (dlg.isOK()) {
throw new ReportException("Генерация отчета отменена");
}
res = report.continueReport(chunk);
}
QueryResults results = (QueryResults) res;
UserChoiceDlg userChoiceDlg = new UserChoiceDlg(parent, results,
subreport.getActiveRows(),
subreport.getReport().getQuery().getColumns().getList());
userChoiceDlg.setVisible(true);
if(userChoiceDlg.isOK()) {
ArrayList<Integer> selection = userChoiceDlg.getResult();
if(selection.size() > 0 ) {
results.shrinkTo(selection);
subreport.setDefaultResults(results);
} else {
subreport.clearDefaultResults();
}
subreportTable.updateUI();
}
} catch (ReportException ex) {
Message.warning(this, ex);