Free Support Forum -

Text alignment in a row

Am using Aspose.Cells for java and facing an issue.

Please look at the screen shot attached. The data in first row last col is coming out. My requirement is all the headers present in first row should be visible. and data should get aligned to that.

Please let me know how to do this.


I guess you need to use Auto Fit Columns. Below is a link to technical article on this subject. Please feel free to write back again.

I tried with autofitRow and autoFitColumn also. Nothing seems to be working.

Hi again,

I tried my below source code with latest version of Aspose.Cells JAVA v2.5.4.5[attached] and it is working for me. Please test the latest jar for your requirement and let us know of your feedback.


Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().getSheet(0);
Cells cells = sheet.getCells();
cells.getCell(“A1”).setValue(“Its a Header”);
cells.getCell(“A2”).setValue(“Its a value”);

Able to do it. was using Styleflag and that was causing issue in setting this.Thank you.