Search in sources :

Example 11 with WorksheetSpec

use of org.isisaddons.module.excel.dom.WorksheetSpec 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);
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 12 with WorksheetSpec

use of org.isisaddons.module.excel.dom.WorksheetSpec 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);
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) WorksheetContent(org.isisaddons.module.excel.dom.WorksheetContent) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Aggregations

WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)12 Action (org.apache.isis.applib.annotation.Action)10 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)9 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)8 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)5 List (java.util.List)3 CollectionLayout (org.apache.isis.applib.annotation.CollectionLayout)3 ArrayList (java.util.ArrayList)2 Collectors (java.util.stream.Collectors)2 Contributed (org.apache.isis.applib.annotation.Contributed)2 DomainObject (org.apache.isis.applib.annotation.DomainObject)2 Nature (org.apache.isis.applib.annotation.Nature)2 SemanticsOf (org.apache.isis.applib.annotation.SemanticsOf)2 Blob (org.apache.isis.applib.value.Blob)2 ExcelService (org.isisaddons.module.excel.dom.ExcelService)2 Inject (javax.inject.Inject)1 Getter (lombok.Getter)1 NoArgsConstructor (lombok.NoArgsConstructor)1 Setter (lombok.Setter)1 Parameter (org.apache.isis.applib.annotation.Parameter)1