Hi Aspose Team,
Hi,
Workbook workbook = new Workbook();
Worksheet workSheet = workbook.getWorksheets().get(0);
workSheet.getCells().get(2, 1).putValue(100);
Style style = workSheet.getCells().get(“B3”).getStyle();
style.setGradient(true);
style.setTwoColorGradient(Color.fromArgb(255, 255, 255), Color.fromArgb(79, 129, 189), GradientStyleType.HORIZONTAL, 1);
style.getFont().setColor(Color.getRed());
style.setHorizontalAlignment(TextAlignmentType.CENTER);
style.setVerticalAlignment(TextAlignmentType.CENTER);
workSheet.getCells().get(“B3”).setStyle(style);
workSheet.getCells().setRowHeightPixel(2, 53);
//Merge B3:C3 --> B3(merged)
workSheet.getCells().merge(2, 1, 1, 2);
//Set the column width of the merged cell (B3) i.e., B column
workSheet.getCells().setColumnWidth(workSheet.getCells().get(2, 1).getColumn(), 44);
//…Similarly you may set column width of the C column separately.
workbook.save(“out1.xlsx”);
Thanks Sahi,
Hi,