Hello,
Row height in pixel cannot be set if autofitRows is enabled in worksheet.
Code Sample:
package test;
import com.aspose.cells.AutoFitterOptions;
import com.aspose.cells.Cell;
import com.aspose.cells.Cells;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
public class TestRowSqueeze{
public static void main(String[] args)
{
Workbook workbook;
try {
workbook = new Workbook(“C:\Test.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(1);
Cell cell = worksheet.getCells().get(“C3”);
cell.putValue(“Slide Title”);
Cells cells = worksheet.getCells();
//Setting the Row Height in Pixel
cells.setRowHeightPixel(10, 1);
AutoFitterOptions autoOptions = new AutoFitterOptions();
autoOptions.setAutoFitMergedCells(true);
try {
worksheet.autoFitRows(autoOptions);
worksheet.autoFitColumns(autoOptions);
} catch (Exception e) {
e.printStackTrace();
}
cells.convertStringToNumericValue();
System.out.println(“cell.getValue” + cell.getValue());
workbook.save(“C:\Test.xlsx”);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
Hi,