Cell - Text style - RotationAngle and Alignment- AutoFitColumn

Hi,

I have some problem with RotationAngle and Alignment using together.
I set RotationAngle to 90. Next - VerticalAlignment to Bottom.
When I save this workbook to XLSX, everything is correct.
But, finally - when I save Workbook to HTML file - there is problem.
First - Alignment doesn't work. Text go out of cell (almost 50%) [I attached image]

Next problem - when I use AutoFitColumn - again - in XLSX is correct, but when save to HTML:
width of cell is ok but vertical alignment again - wrong. I attached second picture. On the screen i set alignment to CENTER.

Sum up - the main problem is when trying to save to HTML. Excel prepare everything exactly like i want.

Hi,


Thanks for the screenshots with details.

Could you provide us your template Excel file here, we will check it soon.

Thank you.

Of course, there it is :slight_smile:

Hi,


Thanks for the template file.

After an initial test, I observed the issue as you mentioned by converting your template file to HTML file format. I found that alignment doesn’t work fine and text go out of the cell in Excel to HTML conversion.
e.g
Sample code:

Workbook workbook = new Workbook(“e:\test2\sample.xlsx”);
workbook.Save(“e:\test2\out1.html”, SaveFormat.Html);

By the way, if I open your template file into MS Excel and then save it as “Web Page” manually, it does not show the contents in 90 degree rotation angle but the cells are inside the cells (horizontally) when I open into the browser. We generally follow MS Excel standards when rendering to HTML file format. I have logged an investigation ticket with an id “CELLSNET-45076” for your issue. Our concerned developer will check if we could support your needs or not.

Once we have an update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

We are working over your issue and we are hopeful, it will be fixed soon. Once, the fix is available for you, we will update you on this thread with download link of a fix.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v17.2.3 (attached).
  • Aspose.Cells for .NET v17.2.3 (.NET 2.0)
  • Aspose.Cells for .NET v17.2.3 (.NET 4.0)
(Note: please choose any of the fixes for your .NET framework version).

Your issue should be fixed in it.

Let us know your feedback.

Thank you.

Hi,


Thank You for information.

I have tested fix and it is almost ok.
When I use only one way - alignment or autofit columns it’s ok.
But, when I make AutoFitColumns after alignment text to bottom I still have wrong output.

To show I have created screenshot for you.

Hi,


Thanks for the screenshots.

Could you attach your template files (Excel file and HTML file - you may make a zipped archive of the files) and paste the sample code to reproduce the issue our end, we will check it soon.

Thank you.

The sample is still the same like before.


In code, it’s look like:


var cell = Worksheet.Cells[“B2”];
var style = cell.GetStyle();
style.VerticalAlignment = TextAlignmentType.Bottom;
style.HorizontalAlignment = TextAlignmentType.Center;
style.RotationAngle = 90;
cell.setStyle(style);

Worksheet.AutoFitColumns();


And after AutoFitColumns output is looking not good.

Hi,


Thanks for providing further details.

I evaluated your scenario/ case a bit and I noticed an issue with E2 cell’s text which is not rendered fine, see the screenshot for your reference:
http://prntscr.com/edz1nh

Do you confirm this is the only issue you are referring to or you find other issues, please elaborate with some screenshots here, we will check and log a ticket for it.

e.g
Sample code:

Workbook workbook = new Workbook(“e:\test2\sample.xlsx”);

//No need to set the alignment and rotation angle as it is already set.
/*
Cell cell = workbook.Worksheets[0].Cells[“B2”];
Style style = cell.GetStyle();
style.VerticalAlignment = TextAlignmentType.Bottom;
style.HorizontalAlignment = TextAlignmentType.Center;
style.RotationAngle = 90;
cell.SetStyle(style);
*/

workbook.Worksheets[0].AutoFitColumns();


workbook.Save(“e:\test2\out1.html”, SaveFormat.Html);


Thank you.

Yes, I can confirm that. The scale of problem depends on length of text in cell.

On your picture, text should be alignment to bottom edge.

Hi,


Thanks for the confirmation.

I have logged a separate ticket with an id “CELLSNET-45170” for your issue:
CELLSNET-45170 - Some text is overlapping with other cells and vertical alignment is not right when applying auto-fit columns operation

Our concerned developer from product team will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v17.3.3 (attached).

Aspose.Cells for .NET v17.3.3 (.NET 2.0)
Aspose.Cells for .NET v17.3.3 (.NET 4.0)
(Note: please choose any of the fixes for your underlying .NET framework version)

Your issue should be fixed in it.

Let us know your feedback.

Thank you.

Hello,


I have tested new version and still have a few problems.
When I try only Alignment (without autofit) then it’s fine. Alignment is correct.
But when I try AutoFitColumn - width of columns are correct but still are problems with alignment. I attached the screenshot.

Hi,


Thanks for the screenshot.

It looks like you are using some other file (other than sample.xlsx). I have tested it using the following sample code with your original file, it works fine, the output file fine tuned. Please provide your template file and output HTML file. You may zip the archive, we will check it soon.
e.g
Sample code:

Workbook workbook = new Workbook(“e:\test2\sample.xlsx”);
workbook.Worksheets[0].AutoFitColumns();
workbook.Save(“e:\test2\out1.html”, SaveFormat.Html);

Thank you.

Ah, yes. I was testing it in a little bigger set. I attached new sample.

Hi,


Thanks for the new file.

After an initial test, I am able to reproduce the issue. I noticed some text is overlapping or invisible and vertical alignment is not right in Excel to HTML rendering.
e.g
Sample code:

Workbook workbook = new Workbook(“e:\test2\extra_sample.xlsx.xlsx”);

workbook.Worksheets[0].AutoFitColumns();

workbook.Save(“e:\test2\out1.html”, SaveFormat.Html);

I have logged a separate ticket with an id “CELLSNET-45248” for your issue. We will look into it soon.

Once w4e have an update on it, we will let you know here.

Thank you.

Hi,


This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-45248”) now. We will soon provide you the fix after performing QA and incorporating other enhancements and fixes.

Thank you.
Hi,

Thanks for using Aspose.Cells.

Please download and try the following latest fix

Aspose.Cells for .NET (Latest Version)
and let us know your feedback.