Free Support Forum -

Convert code to dynamically create html table to create excel content


I am new to aspose. I have a solution where I loop through 2 dataviews and based on the view I dynamically create a number of html tables which I then add to my webpage.
some thing like
Dim tt As New Table
tt.BorderColor = Drawing.Color.Beige
tt.CellPadding = “3”
tt.ID = “”

Dim th As New TableHeaderRow()
Dim thc As New TableHeaderCell()
thc.Text = “Patient”
Now I would like to use aspose to export the data from the webpage to excel and would like to reuse as much of my code as possible. Is there anything equivalent to the above in aspose.cells? In the examples I have found it looks like I have to specify which cell to put my content into and this makes it a bit troublesome as size an number of tables will vary each time.
thanks for any help
br Hans Jørgen


Well, I am afraid, the Html tags/attributes like Table, Img etc. are not supported at the moment. We have already logged it into our issue tracking system with an issue id: CELLSNET-17515. We might look into it in future though.

I think, for you need, you may try to import from DataTable/DataView etc. (Aspose.Cells does provide to import/export this feature providing some methods accordingly), but the data would be pure, there would be no formatting imported. For this, you may use Style formatting options (provided by Aspose.Cells API) to format your selective data in a cell, you can use borders options to implement table attributes, see some topics for your reference:

Thank you.