mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Renamed ExcelPoiStyleCustomizerInterface to ExcelPoiBasedStreamingStyleCustomizerInterface; support (by skipping) null column widths
This commit is contained in:
@ -56,7 +56,7 @@ public class StreamedSheetWriter
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public void beginSheet(QReportView view, ExcelPoiStyleCustomizerInterface styleCustomizerInterface) throws IOException
|
public void beginSheet(QReportView view, ExcelPoiBasedStreamingStyleCustomizerInterface styleCustomizerInterface) throws IOException
|
||||||
{
|
{
|
||||||
writer.write("""
|
writer.write("""
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@ -69,10 +69,14 @@ public class StreamedSheetWriter
|
|||||||
{
|
{
|
||||||
writer.write("<cols>");
|
writer.write("<cols>");
|
||||||
for(int i = 0; i < columnWidths.size(); i++)
|
for(int i = 0; i < columnWidths.size(); i++)
|
||||||
|
{
|
||||||
|
Integer width = columnWidths.get(i);
|
||||||
|
if(width != null)
|
||||||
{
|
{
|
||||||
writer.write("""
|
writer.write("""
|
||||||
<col min="%d" max="%d" width="%d" customWidth="1"/>
|
<col min="%d" max="%d" width="%d" customWidth="1"/>
|
||||||
""".formatted(i + 1, i + 1, columnWidths.get(i)));
|
""".formatted(i + 1, i + 1, width));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
writer.write("</cols>");
|
writer.write("</cols>");
|
||||||
}
|
}
|
||||||
@ -86,7 +90,7 @@ public class StreamedSheetWriter
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public void endSheet(QReportView view, ExcelPoiStyleCustomizerInterface styleCustomizerInterface) throws IOException
|
public void endSheet(QReportView view, ExcelPoiBasedStreamingStyleCustomizerInterface styleCustomizerInterface) throws IOException
|
||||||
{
|
{
|
||||||
writer.write("</sheetData>");
|
writer.write("</sheetData>");
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ package com.kingsrook.qqq.backend.core.actions.reporting.excel;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.kingsrook.qqq.backend.core.actions.reporting.excel.poi.ExcelPoiStyleCustomizerInterface;
|
import com.kingsrook.qqq.backend.core.actions.reporting.excel.poi.ExcelPoiBasedStreamingStyleCustomizerInterface;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.reporting.QReportView;
|
import com.kingsrook.qqq.backend.core.model.metadata.reporting.QReportView;
|
||||||
import org.apache.poi.ss.usermodel.CreationHelper;
|
import org.apache.poi.ss.usermodel.CreationHelper;
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
@ -35,7 +35,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public class TestExcelStyler implements ExcelPoiStyleCustomizerInterface
|
public class TestExcelStyler implements ExcelPoiBasedStreamingStyleCustomizerInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
Reference in New Issue
Block a user