Skip to content

Instantly share code, notes, and snippets.

@firegloves
Last active July 11, 2019 14:21
Show Gist options
  • Save firegloves/b349006d8e3b6a1e3a0c124518709bb0 to your computer and use it in GitHub Desktop.
Save firegloves/b349006d8e3b6a1e3a0c124518709bb0 to your computer and use it in GitHub Desktop.
MemPOI - The most basic example returning created filename's String
try {
// creates destination file
File file = new File("test.xlsx");
// creates MemPOI using its builder
MemPOI memPOI = MempoiBuilder.aMemPOI()
.withFile(file)
.addMempoiSheet(new MempoiSheet(prepStmt))
.build();
// exports to file
CompletableFuture<String> fut = memPOI.prepareMempoiReportToFile();
// gets the generated report absolute filename
String absoluteFileName = fut.get();
} catch (Exception e) {
throw new MempoiRuntimeException(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment