DialogSelectInsurer dlg = new DialogSelectInsurer(MainWindow.mainWindow, writerList);
dlg.setVisible(true);
if (dlg.getDlgResult() != ModalDialog.DLG_OK) {
return;
}
WriterAbstract writer = dlg.getResult();
TableModelRegister model = new TableModelRegister(writer);
HashMap<String, Object> data = new LinkedHashMap<String, Object>();
ConfigLocal configLocal = ConfigLocal.getInstance();
DirectoryCollaboratorItem director = UserInfo.get().getCollaborator().getLpu().getChiefDoctor();
DirectoryCollaboratorItem accountantGeneral = UserInfo.get().getCollaborator().getLpu().getAccountant();
Pair<Date, Date> dates = model.getDates();
data.put("count", String.valueOf(model.getRowCount()));
data.put("director", director == null ? "" : director.toString());
data.put("buh", accountantGeneral == null ? "" : accountantGeneral.toString());
data.put("datefrom", dates.first == null ? "" : Converter.dateToString(dates.first));
data.put("datetill", dates.first == null ? "" : Converter.dateToString(dates.second));
data.put("insurer", model.getInsurerTitle());
data.put("currentdate", model.getDateGenerated() == null ? "" : Converter.dateToString(model.getDateGenerated()));
FormReportCreator report = ReporterFactory.createFormReporter(getClass(), 2);
report.createReport(data, model);
report.finish();
//PrintCreators.createGeneratedReport(title, null, data.entrySet(), null, model, getClass());
try {
writer.closeRegLpu();
} catch (IOException ex) {
MessageBox.showException(ex);
}
} catch (ClipsException ex) {
MessageBox.showException(ex);