mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
convert tabs to spaces
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90e58b6a04
commit
d3c7aa4dcf
@ -27,23 +27,23 @@ import java.io.IOException;
|
||||
|
||||
public class DeferredGeneration {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
try (DeferredSXSSFWorkbook wb = new DeferredSXSSFWorkbook()) {
|
||||
DeferredSXSSFSheet sheet1 = wb.createSheet("new sheet");
|
||||
public static void main(String[] args) throws IOException {
|
||||
try (DeferredSXSSFWorkbook wb = new DeferredSXSSFWorkbook()) {
|
||||
DeferredSXSSFSheet sheet1 = wb.createSheet("new sheet");
|
||||
|
||||
sheet1.setRowGenerator((ssxSheet) -> {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Row row = ssxSheet.createRow(i);
|
||||
Cell cell = row.createCell(1);
|
||||
cell.setCellValue("value " + i);
|
||||
}
|
||||
});
|
||||
sheet1.setRowGenerator((ssxSheet) -> {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Row row = ssxSheet.createRow(i);
|
||||
Cell cell = row.createCell(1);
|
||||
cell.setCellValue("value " + i);
|
||||
}
|
||||
});
|
||||
|
||||
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
|
||||
wb.write(fileOut);
|
||||
} finally {
|
||||
wb.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
|
||||
wb.write(fileOut);
|
||||
} finally {
|
||||
wb.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,30 +25,30 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
|
||||
public class Outlining {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
Outlining o = new Outlining();
|
||||
o.collapseRow();
|
||||
}
|
||||
public static void main(String[] args) throws IOException {
|
||||
Outlining o = new Outlining();
|
||||
o.collapseRow();
|
||||
}
|
||||
|
||||
private void collapseRow() throws IOException {
|
||||
try (SXSSFWorkbook wb2 = new SXSSFWorkbook(100)) {
|
||||
SXSSFSheet sheet2 = wb2.createSheet("new sheet");
|
||||
private void collapseRow() throws IOException {
|
||||
try (SXSSFWorkbook wb2 = new SXSSFWorkbook(100)) {
|
||||
SXSSFSheet sheet2 = wb2.createSheet("new sheet");
|
||||
|
||||
int rowCount = 20;
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
sheet2.createRow(i);
|
||||
}
|
||||
int rowCount = 20;
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
sheet2.createRow(i);
|
||||
}
|
||||
|
||||
sheet2.groupRow(4, 9);
|
||||
sheet2.groupRow(11, 19);
|
||||
sheet2.groupRow(4, 9);
|
||||
sheet2.groupRow(11, 19);
|
||||
|
||||
sheet2.setRowGroupCollapsed(4, true);
|
||||
sheet2.setRowGroupCollapsed(4, true);
|
||||
|
||||
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
||||
wb2.write(fileOut);
|
||||
} finally {
|
||||
wb2.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
||||
wb2.write(fileOut);
|
||||
} finally {
|
||||
wb2.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user