org.apache.poi.ss.usermodel.Sheet.setAutoFilter()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(282)

本文整理了Java中org.apache.poi.ss.usermodel.Sheet.setAutoFilter()方法的一些代码示例,展示了Sheet.setAutoFilter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Sheet.setAutoFilter()方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.Sheet
类名称:Sheet
方法名:setAutoFilter

Sheet.setAutoFilter介绍

[英]Enable filtering for a range of cells
[中]对一系列单元格启用筛选

代码示例

代码示例来源:origin: com.helger/ph-poi

/**
 * @param nRowIndex
 *        The 0-based index of the row, where to set the filter. Add an auto
 *        filter on all columns in the current sheet.
 */
public void autoFilterAllColumns (@Nonnegative final int nRowIndex)
{
 // Set auto filter on all columns
 // Use the specified row (param1, param2)
 // From first column to last column (param3, param4)
 m_aLastSheet.setAutoFilter (new CellRangeAddress (nRowIndex, nRowIndex, 0, m_nMaxCellIndex - 1));
}

代码示例来源:origin: com.phloc/phloc-poi

/**
 * @param nRowIndex
 *          The 0-based index of the row, where to set the filter. Add an auto filter on all
 *          columns in the current sheet.
 */
public void autoFilterAllColumns (@Nonnegative final int nRowIndex)
{
 // Set auto filter on all columns
 // Use the specified row (param1, param2)
 // From first column to last column (param3, param4)
 this.m_aLastSheet.setAutoFilter (new CellRangeAddress (nRowIndex,
                             nRowIndex,
                             0,
                             this.m_nMaxCellIndex - 1));
}

代码示例来源:origin: micromata/projectforge

/**
 * Set auto-filter for the whole first row. Must be called after adding the first row with all heading cells.
 *
 * @return this for chaining.
 */
public ExportSheet setAutoFilter()
{
 final int headingRow = 0;
 final ExportRow row = getRow(headingRow);
 final int lastCol = row.getMaxCol();
 final CellRangeAddress range = new CellRangeAddress(headingRow, headingRow, 0, lastCol);
 getPoiSheet().setAutoFilter(range);
 return this;
}

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-commons

sheet.setAutoFilter(new CellRangeAddress(0, 1 + rows.size(),0, lastColumnIndex - 1));
return wb;

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-commons

sheet.setAutoFilter(new CellRangeAddress(0, 1 + rows.size(), 0, 3));
return wb;

代码示例来源:origin: micromata/projectforge

/**
  * @see org.projectforge.export.DOListExcelExporter#onBeforeExcelDownload(org.projectforge.export.MyExcelExporter)
  */
 @Override
 public void onBeforeDownload()
 {
  final InvoicesExcelExport invoicesExport = new InvoicesExcelExport();
  forecast = getForecast();
  final LiquidityForecastCashFlow cashFlow = new LiquidityForecastCashFlow(forecast);
  cashFlow.addAsExcelSheet(this, getString("plugins.liquidityplanning.forecast.cashflow"));
  final ExportSheet sheet = addSheet(getString("filter.all"));
  addList(sheet, forecast.getEntries());
  sheet.getPoiSheet().setAutoFilter(org.apache.poi.ss.util.CellRangeAddress.valueOf("A1:F1"));
  invoicesExport.addDebitorInvoicesSheet(this, getString("fibu.rechnungen"), forecast.getInvoices());
  invoicesExport.addCreditorInvoicesSheet(this, getString("fibu.eingangsrechnungen"),
    forecast.getCreditorInvoices());
 }
};

相关文章

微信公众号

最新文章

更多