1111import cn .idev .excel .write .metadata .WriteSheet ;
1212import cn .idev .excel .write .metadata .fill .FillConfig ;
1313import cn .idev .excel .write .metadata .fill .FillWrapper ;
14- import org .apache .poi .ss .usermodel .Sheet ;
15- import org .apache .poi .ss .util .CellRangeAddress ;
16- import org .junit .jupiter .api .Test ;
17-
1814import java .io .File ;
1915import java .util .Date ;
2016import java .util .HashMap ;
2117import java .util .List ;
2218import java .util .Map ;
19+ import org .apache .poi .ss .usermodel .Sheet ;
20+ import org .apache .poi .ss .util .CellRangeAddress ;
21+ import org .junit .jupiter .api .Test ;
2322
2423/**
2524 * Example of writing and filling data into Excel
@@ -79,7 +78,7 @@ public void listFill() {
7978 // Option 2: Fill in multiple passes, using file caching (saves memory)
8079 fileName = TestFileUtil .getPath () + "listFill" + System .currentTimeMillis () + ".xlsx" ;
8180 try (ExcelWriter excelWriter =
82- FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
81+ FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
8382 WriteSheet writeSheet = FastExcel .writerSheet ().build ();
8483 excelWriter .fill (data (), writeSheet );
8584 excelWriter .fill (data (), writeSheet );
@@ -102,7 +101,7 @@ public void complexFill() {
102101 String fileName = TestFileUtil .getPath () + "complexFill" + System .currentTimeMillis () + ".xlsx" ;
103102 // Option 1
104103 try (ExcelWriter excelWriter =
105- FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
104+ FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
106105 WriteSheet writeSheet = FastExcel .writerSheet ().build ();
107106 // Note: The forceNewRow parameter is used here. When writing a list, it will always create a new row, and
108107 // the data below will be shifted down. Default is false, which will use the next row if available,
@@ -142,7 +141,7 @@ public void complexFillWithTable() {
142141
143142 // Option 1
144143 try (ExcelWriter excelWriter =
145- FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
144+ FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
146145 WriteSheet writeSheet = FastExcel .writerSheet ().build ();
147146 // Directly write data
148147 excelWriter .fill (data (), writeSheet );
@@ -188,7 +187,7 @@ public void horizontalFill() {
188187 String fileName = TestFileUtil .getPath () + "horizontalFill" + System .currentTimeMillis () + ".xlsx" ;
189188 // Option 1
190189 try (ExcelWriter excelWriter =
191- FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
190+ FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
192191 WriteSheet writeSheet = FastExcel .writerSheet ().build ();
193192 FillConfig fillConfig = FillConfig .builder ()
194193 .direction (WriteDirectionEnum .HORIZONTAL )
@@ -220,7 +219,7 @@ public void compositeFill() {
220219
221220 // Option 1
222221 try (ExcelWriter excelWriter =
223- FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
222+ FastExcel .write (fileName ).withTemplate (templateFileName ).build ()) {
224223 WriteSheet writeSheet = FastExcel .writerSheet ().build ();
225224 FillConfig fillConfig = FillConfig .builder ()
226225 .direction (WriteDirectionEnum .HORIZONTAL )
0 commit comments