CE-881 - Add booleans supportsNativePivotTables and supportsMultipleViews

This commit is contained in:
2024-04-01 08:59:17 -05:00
parent a24033f572
commit 8c01e87499

View File

@ -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.actions.reporting.excel.poi.ExcelPoiBasedStreamingExportStreamer;
import com.kingsrook.qqq.backend.core.exceptions.QUserFacingException; import com.kingsrook.qqq.backend.core.exceptions.QUserFacingException;
import com.kingsrook.qqq.backend.core.utils.StringUtils; 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 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. // // 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), XLSX(SpreadsheetVersion.EXCEL2007.getMaxRows(), SpreadsheetVersion.EXCEL2007.getMaxColumns(), ExcelPoiBasedStreamingExportStreamer::new, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx", true, true, true),
CSV(null, null, CsvExportStreamer::new, "text/csv", "csv", false), JSON(null, null, JsonExportStreamer::new, "application/json", "json", false, false, true),
LIST_OF_MAPS(null, null, ListOfMapsExportStreamer::new, null, null, false); 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; private final Integer maxRows;
@ -56,6 +55,8 @@ public enum ReportFormat
private final String mimeType; private final String mimeType;
private final String extension; private final String extension;
private final boolean isBinary; private final boolean isBinary;
private final boolean supportsNativePivotTables;
private final boolean supportsMultipleViews;
private final Supplier<? extends ExportStreamerInterface> streamerConstructor; private final Supplier<? extends ExportStreamerInterface> streamerConstructor;
@ -64,7 +65,7 @@ public enum ReportFormat
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
ReportFormat(Integer maxRows, Integer maxCols, Supplier<? extends ExportStreamerInterface> streamerConstructor, String mimeType, String extension, boolean isBinary) ReportFormat(Integer maxRows, Integer maxCols, Supplier<? extends ExportStreamerInterface> streamerConstructor, String mimeType, String extension, boolean isBinary, boolean supportsNativePivotTables, boolean supportsMultipleViews)
{ {
this.maxRows = maxRows; this.maxRows = maxRows;
this.maxCols = maxCols; this.maxCols = maxCols;
@ -72,6 +73,8 @@ public enum ReportFormat
this.streamerConstructor = streamerConstructor; this.streamerConstructor = streamerConstructor;
this.extension = extension; this.extension = extension;
this.isBinary = isBinary; this.isBinary = isBinary;
this.supportsNativePivotTables = supportsNativePivotTables;
this.supportsMultipleViews = supportsMultipleViews;
} }
@ -160,4 +163,26 @@ public enum ReportFormat
{ {
return isBinary; return isBinary;
} }
/*******************************************************************************
** Getter for supportsNativePivotTables
**
*******************************************************************************/
public boolean getSupportsNativePivotTables()
{
return supportsNativePivotTables;
}
/*******************************************************************************
** Getter for supportsMultipleViews
**
*******************************************************************************/
public boolean getSupportsMultipleViews()
{
return supportsMultipleViews;
}
} }