先按行再按列填充数据

先按行再按列填充数据

将数据按顺序 A1、B1、A2、B2 放置比 A1、A2、B1、B2 更快。如果工作表中有很多单元格并且您遵循第二个顺序,即逐行填充数据,则此提示可以使程序更快。

Java 先按行再按列填充数据的代码

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(PopulateDatabyRowthenColumn.class);
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").setValue("data1");
cells.get("B1").setValue("data2");
cells.get("A2").setValue("data3");
cells.get("B2").setValue("data4");