We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Different cell orientation within the same row

Hi

We are currently evaluating your product and I am trying to reproduce one of our main reports with it. I am having difficulty with the following: I need to have horizontal and vertical text orientation within the same row of a table but all cells end up getting the orientation of the last cell orientation that I set. For example:

builder.StartTable();
builder.CellFormat.Orientation = TextOrientation.Horizontal;
builder.InsertCell();
builder.Write(“Horizontal”);
builder.CellFormat.Orientation = TextOrientation.Downward;
builder.InsertCell();
builder.Write(“Downward”);
builder.EndRow();
builder.EndTable();

One more thing - how do I get the row to vertically size automatically for vertical text - ‘builder.RowFormat.HeightRule = HeightRule.Auto’ does not seem to work.

Thank you

Hi

Thanks for your inquiry. Please try using the following code snippet.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.RowFormat.HeightRule = HeightRule.Auto;

builder.RowFormat.AllowAutoFit = false;

builder.InsertCell();

builder.CellFormat.Orientation = TextOrientation.Horizontal;

builder.Write("Horizontal Horizontal Horizontal Horizontal Horizontal");

builder.InsertCell();

builder.CellFormat.Orientation = TextOrientation.Downward;

builder.Write("Downward");

builder.EndRow();

builder.EndTable();

doc.Save(@"Test035\out.doc");

Hope this helps.

Best regards.

Hi

Thanks for the quick response - much appreciated.

I am still having a problem with the auto sizing. You can see this by simply changing your code as follows:

<span style=“font-size: 10pt; font-family: “Courier New”;” lang=“EN-US”>builder.Write(‘Horizontal’)

as opposed to the longer string with repetitions of the word ‘Horizontal’.

You will see now that the downward cell does not resize vertically properly to fit the word.

Mike

Hi

Thanks for your inquiry. Please try doing the same using MS Word. Cell can be resized horizontally but can’t be resized vertically if you use downward or upward text direction.

Best regards.