Free Support Forum - aspose.com

Problems about HTML import

Hi,

I' m using Aspose 4.0 Beta and the problems about HTML import continue. When I try to use builder.ImportHMTL(), all the tables that I put after it didn't weel formed.

Please, Help me.

Thanks in asvance,

Aline

Please attach the HTML that you are using.

I am using the HTML following:

"

  05/04 06/04 07/04 08/04 09/04 10/04 11/04 12/04 01/05 02/05 03/05 04/05 05/05 06/05
Linha de Base% 0 0 0,06 0,45 1,61 4,01 8 14,18 22,52 32,61 43,97 55,72 66,73 75,83
Linha de Base Aditivo 1 % - - - - - - - - - - - - - 39,01
Linha de Base Aditivo 2 % - - - - - - - - - - - - - -
Projetados % - - - - - - - - - - - - - 39,01
Real % 0 0,03 0,03 4,05 6,99 14,47 21,44 25,14 26,96 27,85 29,89 33,66 35,66 39,01
  07/05 08/05 09/05 10/05 11/05 12/05 01/06 02/06 03/06 04/06 05/06 06/06 07/06 08/06
Linha de Base% 82,46 87,53 91,6 94,75 97,11 98,69 99,58 99,93 99,99 99,99 99,99 99,99 99,99 99,99
Linha de Base Aditivo 1 % 41,25 47,98 56,15 63,79 71,41 77,84 85,11 90,59 96,51 98,63 99,1 99,22 99,86 100
Linha de Base Aditivo 2 % - - - - - - - 74,62 77,79 80,96 84,13 87,3 90,47 93,64
Projetados % 41,25 47,98 56,15 60,5 62,5 65,64 69,34 74,62 80,69 83,5 87,43 89,2 91,45 93,66
Real % 41,25 47,98 56,15 60,5 62,5 65,64 69,34 74,62 80,69 83,5 87,43 - - -
  09/06 10/06 11/06 12/06 01/07 02/07 03/07 04/07 05/07 06/07            
Linha de Base% 99,99 99,99 99,99 99,99 99,99 99,99 99,99 99,99 99,99 99,99 - - - -
Linha de Base Aditivo 1 % 100 100 100 100 100 100 100 100 100 100 - - - -
Linha de Base Aditivo 2 % 96,81 99,98 99,98 99,98 99,98 99,98 99,98 99,98 99,98 99,98 - - - -
Projetados % 96,83 100 100 100 100 100 100 100 100 100 - - - -
Real % - - - - - - - - - - - - - -
"

Hi,

Thanks for posting. So what exactly does not satisfy you in the resulting table?

After the command builder.InsertHtml("something"), all the tables generated by builder.StartTable()... aren't rendered.

Thanks,

Aline

I've tested the case and you seem to be correct. I've logged it as issue #1277. We'll try to fix it quickly. Thank you for reporting it.

We tried this type of test:

StreamReader reader = new StreamReader(TestUtil.BuildTestFileName(@"Defects\TestDefect1277.html"));

string html = reader.ReadToEnd();

DocumentBuilder builder = new DocumentBuilder();

builder.InsertHtml(html);

builder.StartTable();

builder.InsertCell();

builder.Write("Test");

builder.InsertCell();

builder.Write("Test");

builder.InsertCell();

builder.Write("Test");

builder.EndRow();

builder.EndTable();

TestUtil.Save(builder.Document, @"Defects\TestDefect1277 Out.doc");

Indeed, the cells of the table created using the builder after InsertHtml come out with zero length. This is a defect that we will fix, but it is a cosmetic one. When creating tables in Aspose.Words you SHOULD specify cell width explicitly. If you don't specify cell width, then the best "correct" behaviour DocumentBuilder will be to create cells with 1 inch wide which is probably not what you want anyway. Therefore, you should just proceed by setting cell width. You don't need to wait for a fix.

builder.StartTable();

builder.CellFormat.Width = 100;

builder.InsertCell();

The issue #1277 is fixed in Aspose.Words 4.0.1. Please download and try with this new version.