From 8c01e8749953db9e03e8047deda02ad353fb2d50 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Mon, 1 Apr 2024 08:59:17 -0500 Subject: [PATCH] CE-881 - Add booleans supportsNativePivotTables and supportsMultipleViews --- .../model/actions/reporting/ReportFormat.java | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/actions/reporting/ReportFormat.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/actions/reporting/ReportFormat.java index 3234e6b3..c72056f4 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/actions/reporting/ReportFormat.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/actions/reporting/ReportFormat.java @@ -31,7 +31,7 @@ import com.kingsrook.qqq.backend.core.actions.reporting.ListOfMapsExportStreamer import com.kingsrook.qqq.backend.core.actions.reporting.excel.poi.ExcelPoiBasedStreamingExportStreamer; import com.kingsrook.qqq.backend.core.exceptions.QUserFacingException; import com.kingsrook.qqq.backend.core.utils.StringUtils; -import org.dhatim.fastexcel.Worksheet; +import org.apache.poi.ss.SpreadsheetVersion; /******************************************************************************* @@ -39,16 +39,15 @@ import org.dhatim.fastexcel.Worksheet; *******************************************************************************/ public enum ReportFormat { - XLSX(Worksheet.MAX_ROWS, Worksheet.MAX_COLS, ExcelPoiBasedStreamingExportStreamer::new, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx", true), - ///////////////////////////////////////////////////////////////////////// // if we need to fall back to Fastexcel, this was its version of this. // ///////////////////////////////////////////////////////////////////////// - // XLSX(Worksheet.MAX_ROWS, Worksheet.MAX_COLS, ExcelFastexcelExportStreamer::new, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx"), + // XLSX(Worksheet.MAX_ROWS, Worksheet.MAX_COLS, ExcelFastexcelExportStreamer::new, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx", true, false, true), - JSON(null, null, JsonExportStreamer::new, "application/json", "json", false), - CSV(null, null, CsvExportStreamer::new, "text/csv", "csv", false), - LIST_OF_MAPS(null, null, ListOfMapsExportStreamer::new, null, null, false); + XLSX(SpreadsheetVersion.EXCEL2007.getMaxRows(), SpreadsheetVersion.EXCEL2007.getMaxColumns(), ExcelPoiBasedStreamingExportStreamer::new, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx", true, true, true), + JSON(null, null, JsonExportStreamer::new, "application/json", "json", false, false, true), + CSV(null, null, CsvExportStreamer::new, "text/csv", "csv", false, false, false), + LIST_OF_MAPS(null, null, ListOfMapsExportStreamer::new, null, null, false, false, true); private final Integer maxRows; @@ -56,6 +55,8 @@ public enum ReportFormat private final String mimeType; private final String extension; private final boolean isBinary; + private final boolean supportsNativePivotTables; + private final boolean supportsMultipleViews; private final Supplier streamerConstructor; @@ -64,7 +65,7 @@ public enum ReportFormat /******************************************************************************* ** *******************************************************************************/ - ReportFormat(Integer maxRows, Integer maxCols, Supplier streamerConstructor, String mimeType, String extension, boolean isBinary) + ReportFormat(Integer maxRows, Integer maxCols, Supplier streamerConstructor, String mimeType, String extension, boolean isBinary, boolean supportsNativePivotTables, boolean supportsMultipleViews) { this.maxRows = maxRows; this.maxCols = maxCols; @@ -72,6 +73,8 @@ public enum ReportFormat this.streamerConstructor = streamerConstructor; this.extension = extension; this.isBinary = isBinary; + this.supportsNativePivotTables = supportsNativePivotTables; + this.supportsMultipleViews = supportsMultipleViews; } @@ -160,4 +163,26 @@ public enum ReportFormat { return isBinary; } + + + + /******************************************************************************* + ** Getter for supportsNativePivotTables + ** + *******************************************************************************/ + public boolean getSupportsNativePivotTables() + { + return supportsNativePivotTables; + } + + + + /******************************************************************************* + ** Getter for supportsMultipleViews + ** + *******************************************************************************/ + public boolean getSupportsMultipleViews() + { + return supportsMultipleViews; + } }