Class HutoolTitleWriter<R>


public class HutoolTitleWriter<R> extends TitleWriter<R>
  • Field Details

    • parent

      protected ExcelExport parent
    • bigExcelWriter

      public cn.hutool.poi.excel.BigExcelWriter bigExcelWriter
    • currentRow

      protected int currentRow
      当前写入行,切换sheet页时需要还原这个上下文数据
  • Constructor Details

  • Method Details

    • countTitles

      public int countTitles()
      获取当前的表头数量
      Specified by:
      countTitles in class TitleWriter<R>
    • onWrite

      protected void onWrite()
      Description copied from class: Writer
      声明周期钩子函数, 当写入数据时
      Overrides:
      onWrite in class Writer
    • doWrite

      protected void doWrite(List<R> targetDataList)
      以对象形式写入
      Specified by:
      doWrite in class TitleWriter<R>
      Parameters:
      targetDataList - 数据集
    • setColumnWidthDefault

      public HutoolTitleWriter<R> setColumnWidthDefault()
      默认设置列宽 : 简单粗暴将前500列都设置宽度20
    • setColumnWidthAuto

      public void setColumnWidthAuto()
      自动设置列宽
    • setColumnWidth

      public void setColumnWidth(int cols, int width)
      默认设置列宽 : 简单粗暴将前500列都设置宽度
    • getBigExcelWriter

      public cn.hutool.poi.excel.BigExcelWriter getBigExcelWriter()
      内部操作类,但是暴露出来了,希望最好不要用这个方法
      Returns:
    • getWorkbook

      public org.apache.poi.ss.usermodel.Workbook getWorkbook()
      Specified by:
      getWorkbook in class Writer
    • getRunningTimeCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle getRunningTimeCellStyle(ExcelCellStyle style)
      通过内置的样式换取为当前工作簿里面的样式
      Specified by:
      getRunningTimeCellStyle in class Writer
      Parameters:
      style -
      Returns:
    • onSwitchSheet

      protected void onSwitchSheet()
      Description copied from class: Writer
      声明周期钩子函数, 当切换sheet页时
      Overrides:
      onSwitchSheet in class Writer
    • onStopWrite

      protected void onStopWrite()
      Description copied from class: Writer
      声明周期钩子函数, 当执行stopWrite时
      Overrides:
      onStopWrite in class Writer