use of org.olat.core.util.openxml.OpenXMLWorkbook in project OpenOLAT by OpenOLAT.
the class AbstractLectureBlockAuditLogExport method generate.
@Override
protected void generate(OutputStream out) {
Collections.sort(auditLog, new LectureBlockAuditLogComparator());
try (OpenXMLWorkbook workbook = new OpenXMLWorkbook(out, 1)) {
OpenXMLWorksheet exportSheet = workbook.nextWorksheet();
addSheetSettings(exportSheet);
addHeaders(exportSheet);
addHeader(exportSheet);
addContent(exportSheet, workbook);
} catch (IOException e) {
log.error("", e);
} catch (Exception e) {
log.error("", e);
}
}
use of org.olat.core.util.openxml.OpenXMLWorkbook in project OpenOLAT by OpenOLAT.
the class LecturesStatisticsExport method generate.
@Override
protected void generate(OutputStream out) {
try (OpenXMLWorkbook workbook = new OpenXMLWorkbook(out, 2)) {
OpenXMLWorksheet exportSheet = workbook.nextWorksheet();
exportSheet.setHeaderRows(1);
addHeadersAggregated(exportSheet);
addContentAggregated(exportSheet, workbook);
exportSheet = workbook.nextWorksheet();
exportSheet.setHeaderRows(1);
addHeadersDetailled(exportSheet);
addContentDetailled(exportSheet, workbook);
} catch (IOException e) {
log.error("", e);
}
}
use of org.olat.core.util.openxml.OpenXMLWorkbook in project openolat by klemens.
the class XlsFlexiTableExporter method export.
@Override
public MediaResource export(FlexiTableComponent ftC, List<FlexiColumnModel> columns, Translator translator) {
String label = "TableExport_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis())) + ".xlsx";
return new OpenXMLWorkbookResource(label) {
@Override
protected void generate(OutputStream out) {
try (OpenXMLWorkbook workbook = new OpenXMLWorkbook(out, 1)) {
OpenXMLWorksheet sheet = workbook.nextWorksheet();
createHeader(columns, translator, sheet, workbook);
createData(ftC, columns, translator, sheet, workbook);
} catch (IOException e) {
log.error("", e);
}
}
};
}
use of org.olat.core.util.openxml.OpenXMLWorkbook in project openolat by klemens.
the class CheckListExcelExport method exportWorkbook.
public void exportWorkbook(List<AssessmentData> dataList, OutputStream exportStream) {
try (OpenXMLWorkbook workbook = new OpenXMLWorkbook(exportStream, 1)) {
// headers
OpenXMLWorksheet exportSheet = workbook.nextWorksheet();
exportSheet.setHeaderRows(1);
writeHeaders(exportSheet, workbook);
writeData(dataList, exportSheet);
} catch (Exception e) {
log.error("", e);
}
}
use of org.olat.core.util.openxml.OpenXMLWorkbook in project openolat by klemens.
the class DefaultXlsTableExporter method export.
/**
* @see org.olat.core.gui.components.table.TableExporter#export(org.olat.core.gui.components.table.Table)
*/
@Override
public MediaResource export(final Table table) {
Translator translator = table.getTranslator();
int cdcnt = table.getColumnCount();
int rcnt = table.getRowCount();
String label = "TableExport_" + Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis())) + ".xlsx";
return new OpenXMLWorkbookResource(label) {
@Override
protected void generate(OutputStream out) {
try (OpenXMLWorkbook workbook = new OpenXMLWorkbook(out, 1)) {
OpenXMLWorksheet sheet = workbook.nextWorksheet();
createHeader(table, translator, cdcnt, sheet, workbook);
createData(table, cdcnt, rcnt, sheet);
} catch (IOException e) {
log.error("", e);
}
}
};
}
Aggregations