Excel to HTML - no line breaks

Hello,

I’m new to Aspose. I use aspose.cell and I’m trying to convert Excel (.xls) to HTML. In the Excel file there are cells with big texts. The text have automatically line breaks so the they are shown completly and correctly in the cell.

I convert it so:

string path = @“I:\temp\test.xlsx”;
Workbook workbook = new Workbook(path);
//Worksheet worksheet1 = workbook.Worksheets[0];
workbook.Save(path + “.out.html”, Aspose.Cells.SaveFormat.Html);

It creates an HTML. But the texts in the HTML table cells have no line breaks. The text is written in one line over the border of the table cell.

What can I do to put the text correctly into the table cell?

Regards
Ringo


Hi,


Kindly attach your sample input xlsx and output Html files here, we will check your issue soon.

Thank you.

Hi,

I send a test file in the attachment.

Partly I could solve it. I replace the space with \n before I save in html.

string text = “”;
foreach (Cell c in cells)
{
if (c.Value != null)
{
text = c.Value.ToString();
text = text.Replace(" ", “\n”);
c.Value = text;
}
}

But with long words (“testloooooooooooooooooong” in the test.xlsx) I still have no solution.

The output file I cannot send, .htm its not allowed. But there are no line breaks inside the cells.

Regards
Ringo

Hi,


After an initial test, I can find the issue as you have mentioned. I have logged a ticket with an id: CELLSNET-40161. We will look into it soon.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.4.3


Thanks and Kind Regards,

Hello,
and thanks for the fix.

I tryed it, between words there are line breaks now.

But with long words (‘testloooooooooong’ in test.xlsx), which are longer than the cell width, there is still no line break. The words are written over the cells into the next cell. That should not be. In this case the word should wrap at the end of the cell. Could you still fix it, else I cannot use it to convert in html.

Thank you
GEWA-COMP GmbH

Hi,


Please attach your input Excel file and output html files here, Also give us screen shot to show the problematic area using screen shots. We will check it soon.

Thank you.

Here are the input Excel, the output html and the output screenshot files.

Thank you
GEWA-COMP GmbH

Hi,


The issue is still there as you mentioned, I have tested with my code and found the issue as per the screen shot in your zipped archive.
Sample code:
Workbook workbook = new Workbook(“e:\test2\test.xlsx”);
workbook.Save(“e:\test2\outtest.html”, SaveFormat.Html);

I have reopened your issue and we will soon look into it.

Hi,


Also, we checked it works better on IE browser type, but on firefox and Google chrome we can find the issue as you have mentioned. Anyways, we will figure it out soon.

Thank you.

Hello,

could you find out something?

The word wrap with words which are longer than the cell width still does’nt work in Aspose.Cells for .NET 7.4.0.
Its like you said, in IE it works better but not correct, there is no word wrap too. And in Firefox and Chrome the word is written into the next cell.

Thank you.

Hi,


I am afraid, your issue is not fixed completely yet.
I have logged your comments into our database against your existing issue “CELLSNET-40161”.
Anyways, I have asked the concerned developer to look into it further and update or share an eta (if possible).

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

Thank you.

Hi,

it seems that we have the same effect with missing word wrap in the newest version.

Attached please consider the example for your isssue fixing.

Thanks in advance.

Greetings,

Sacha End

Hi Sacha,


Thanks for the files.

I have tested your issue even in MS Excel, I simply opened your template file and save it as web page. The output html file does not look good either regarding wrapping text. You may confirm it doing the same in MS Excel manually and opening the file into IE or Google chrome, you will see the similar display as per the output of the generated file by Aspose.Cells. So, this is not an issue with Aspose.Cells as it follows MS Excel standards.

If you have different opinion and MS Excel behavior differently than Aspose.Cells, please let us know with the details. We will check it soon.

Thank you.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and try this fix: Aspose.Cells for .NET v7.4.1.1 and let us know your feedback.

Hello,

thank you, but as HTML it don’t work. Now its displayed only the first column. So before it was better.

Regards
GEWA-COMP

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have logged your comments in our database. We will look into your issue and help you asap

GEWA-COMP GmbH:
Hello,

thank you, but as HTML it don't work. Now its displayed only the first column. So before it was better.

Regards
GEWA-COMP
Hi,

Thanks for your posting and using Aspose.Cells.

We are unable to understand your posting. Please elaborate yourself more with sample code and screenshots.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v7.7.1.2 and let us know your feedback.

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


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