use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.
the class IncomingInvoiceDownloadManager method downloadToExcel.
@Action(semantics = SemanticsOf.SAFE)
public Blob downloadToExcel(final String fileName) {
final List<IncomingInvoiceExport> exports = getInvoiceItems().stream().map(item -> new IncomingInvoiceExport(item, documentNumberFor(item), codaElementFor(item), commentsFor(item))).sorted(// guard only for (demo)fixtures because in production a document can be expected
Comparator.comparing(x -> x.getDocumentNumber() != null ? x.getDocumentNumber() : "_No_Document")).collect(Collectors.toList());
WorksheetSpec spec = new WorksheetSpec(IncomingInvoiceDownloadManager.exportClass, "invoiceExport");
WorksheetContent worksheetContent = new WorksheetContent(exports, spec);
return excelService.toExcel(worksheetContent, fileName);
}
use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.
the class KeyItemImportExportManager method export.
// region > export (action)
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
@MemberOrder(name = "keyItems", sequence = "1")
public Blob export() {
final String fileName = withExtension(getFileName(), ".xlsx");
WorksheetSpec spec = new WorksheetSpec(KeyItemImportExportLineItem.class, "keyItems");
WorksheetContent worksheetContent = new WorksheetContent(getKeyItems(), spec);
return excelService.toExcel(worksheetContent, fileName);
}
use of org.isisaddons.module.excel.dom.WorksheetContent in project estatio by estatio.
the class InvoiceImportManager method downloadTemplate.
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
public Blob downloadTemplate() {
final String fileName = "template.xlsx";
WorksheetSpec spec = new WorksheetSpec(InvoiceImportLine.class, "invoiceImportLine");
WorksheetContent worksheetContent = new WorksheetContent(getLines(), spec);
return excelService.toExcel(worksheetContent, fileName);
}
Aggregations