Cells.setStandardHeight() is not working

I have created a spreadsheet using jrxml and I am trying to set height of all rows in that spreadsheet to 16 through method Cells.setStandardHeight(16). But this mehtod does not work and my row height in generated sheet is as per the content in it.

Can you please let me know what can be done? I dont want to use autoFitRows() coz of the way my application code is written.

Thanks,
Garima

Hi Garima,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id: CELLSJAVA-14671.

Thank You & Best Regards,

Hi,

Please try this fix (attached). And, please make sure that you call Cells.setStandardHeight() before all the rows being instantiated (such as by calling Cells.getRow()/getCell()) because Cells.setStandardHeight() will only influence this way for those newly created rows and not reset existing rows' height.
Thank you.

I am still having the same issue with new jar also. Lets say the jasper report height is 400 and my detail section comes up to 350, row after my last data row takes up the remaining size of report and that particular row is greater than 16. All other remaining rows of that spreadsheet are size 16.

I have set my document's IGNORE PAGINATION property to "false".

Hi,

We have tested the setStandardHeight() method with the following test code and cannot find the issue. Please confirm us for that and give us your sample code to reproduce the issue.

Here is a test code:

cells.setStandardHeight(16);
Cell cell = cells.getCell(0, 0);
Style style = cell.getStyle();
Font font = style.getFont();
font.setSize(5);
style.setFont(font);
cell.setStyle(style);
cell.setValue("abcdefghijakdjfaldjfka");
cell = cells.getCell(1, 0);
style = cell.getStyle();
style.setTextWrapped(true);
cell.setStyle(style);
cell.setValue("abcdefghijakdjfaldjfka");
cell = cells.getCell(2, 0);
cell.setValue("abcdefghijakdjfaldjfka");
style = cell.getStyle();
font = style.getFont();
font.setSize(15);
style.setFont(font);
cell.setStyle(style);

Thank you.

So is there no way to set auto height of all cells after the content is set? We have a generic java code which fills up the data and then sets aspose properties for the spreadsheet.

So using the above method wouldn't work for us. Please let me know whats the alternative we could use.

Thanks,
Garima

Hi Garima,

I think you may try to call Worksheet.autoFitRow() method to set the row height automatically according to the contents of the cells in a row.

For reference please check: http://www.aspose.com/documentation/java-components/aspose.cells-for-java/autofit-rows-columns.html

Thank you.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

If you have any further requirement, please share your sample code, template and required output file here with details about your issue and requirements. We will look into it soon.

Thank You & Best Regards,

The issues you have found earlier (filed as 14671) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.