addWithName method

Worksheet addWithName(
  1. String name
)

Add worksheet to the collection with name.

Workbook workbook = new Workbook();
workbook.worksheets.addWithName("sample");
workbook.save('Output.xlsx');
workbook.dispose();

Implementation

Worksheet addWithName(String name) {
  final Worksheet worksheet = add();
  worksheet.name = name;
  return worksheet;
}