Get actual height of Row with "At least" or "Auto Height" with wrapped text

Hello,

I’m using aspose.words for Java

I have a Row that contains cells with text wrapping and text fitting enabled. If I explicitly set the height of the row (HeightRule.EXCACTLY), then the wrapped text is not shown. If I don’t explicitly set the height of the row, I can’t (don’t know how to) get the row’s height (Row.getRowFormat.getHeight() returns 0).

I need to either get the height of the row after the text has been added OR determine how high the row will be and set its exact height. Is this even possible? Any help would be appreciated.

Thanks,

awp2513

Hi Andrew,
Thanks for your inquiry. I’m afraid there is no way to find the height of a row which is not set as HeightRule.Exactly. Could you please clarify why you are trying to achieve? Perhaps there is another way to go about this that we can suggest instead.
Thanks,

Hi,

I admit, I’m in a somewhat unique situation. I have two tables created programatically. Both have different row heights, different numbers of cells (vertically), and have to allow text wrap and text fitting. There is no real “template” for these tables.

These tables eventually have to be combined into a single table. Up until now, I’ve been simply nesting them in another 2-column table side-by-side, but this is messy and difficult to format (borders, etc.) because of this nesting.

So, I came up with a (complicated) algorithm to do this in the case were the rows in both tables are explicitly set. It does not, however, allow for text wrapping or fitting, which I need. The best I can do right now is set “at least” for the row height, but then my algorithm incorrectly fits the second table in, thinking rows are shorter than they really are, which ends up making second table’s cells much taller than they need to be.

I would certainly be interested in a solution that allows me to easily merge two tables into a single table, even though the two tables can be different each and every time it happens. When I began looking into this, mail merge did not appear to be the answer, and always created nested tables. Maybe I’m wrong?

Thanks,

awp2513

Hi Andrew,
Thank you for additional information. It would be great if you also attach your code, output and expected output document. We will check them and try to help you to find a solution.
Best regards,