Skip to content

Column and row offset

firegloves edited this page Jul 20, 2022 · 1 revision

Column and Row offsets

You could want to apply a vertical or horizontal offset to the generated data, for example, aiming to enrich your document after the generation. To let the user achieve this goal, MemPOI supports columns and rows offsets. The below code will add:

  • vertical offset of 6 rows: exported data (header included) will start at row 7
  • horizontal offset of 3 columns: exported data will start at column 4
MempoiSheet mempoiSheet = MempoiSheetBuilder.aMempoiSheet()
    .withPrepStmt(prepStmt)
    .withRowsOffset(6)
    .withColumnsOffset(3)
    .build();

MemPOI memPOI = MempoiBuilder.aMemPOI()
    .withFile(fileDest)
    .withAdjustColumnWidth(true)
    .addMempoiSheet(mempoiSheet)
    .build();

The execution of the code above will result in the following export: