/** * @see de.willuhn.jameica.hbci.io.Exporter#doExport(java.lang.Object[], * de.willuhn.jameica.hbci.io.IOFormat, java.io.OutputStream, de.willuhn.util.ProgressMonitor) */ public void doExport(Object[] objects, IOFormat format, OutputStream os, ProgressMonitor monitor) throws RemoteException, ApplicationException { if (objects == null || !(objects instanceof UmsatzTree[])) throw new ApplicationException(i18n.tr("Bitte wählen Sie die zu exportierenden Umsätze aus")); UmsatzTree[] t = (UmsatzTree[]) objects; if (t.length == 0) throw new ApplicationException(i18n.tr("Bitte wählen Sie die zu exportierenden Umsätze aus")); UmsatzTree tree = t[0]; List list = tree.getUmsatzTree(); Konto k = tree.getKonto(); String subTitle = i18n.tr( "Zeitraum {0} - {1}, {2}", HBCI.DATEFORMAT.format(tree.getStart()), HBCI.DATEFORMAT.format(tree.getEnd()), k == null ? i18n.tr("alle Konten") : k.getBezeichnung()); Reporter reporter = null; try { reporter = new Reporter(os, monitor, i18n.tr("Umsatzkategorien"), subTitle, list.size()); reporter.addHeaderColumn(i18n.tr("Kategorie"), Element.ALIGN_CENTER, 130, Color.LIGHT_GRAY); reporter.addHeaderColumn(i18n.tr("Einnahmen"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY); reporter.addHeaderColumn(i18n.tr("Ausgaben"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY); reporter.addHeaderColumn(i18n.tr("Betrag"), Element.ALIGN_CENTER, 30, Color.LIGHT_GRAY); reporter.createHeader(); // Iteration ueber die Kategorien for (int i = 0; i < list.size(); ++i) { renderNode(reporter, (UmsatzTreeNode) list.get(i), 0); reporter.setNextRecord(); } if (monitor != null) monitor.setStatus(ProgressMonitor.STATUS_DONE); } catch (Exception e) { if (monitor != null) monitor.setStatus(ProgressMonitor.STATUS_ERROR); Logger.error("error while creating report", e); throw new ApplicationException( i18n.tr("Fehler beim Erzeugen der Auswertung: {0}", e.getMessage()), e); } finally { if (reporter != null) { try { reporter.close(); } catch (Exception e) { Logger.error("unable to close report", e); } } } }