C
Carlitos
Hi there,
I have a asp.net page that dynamically constructs a table based on data
retrieved from a database. This is an excerpt of the code used:
' Create a row
Dim row As HtmlTableRow = New HtmlTableRow
' Create a column and add it to the row
Dim cell As HtmlTableCell = New HtmlTableCell
cell.InnerText = sValue
row.Cells.Add(cell)
' ... other columns created and added...
tblSummaryTable.Rows.Add(row) ' tblSummaryTable already exists on page,
running at server
' ... loop to add more rows as needed...
Now I need to export this table to a spreadsheet when the user clicks a
button on the page.
I have tried a variety of routines, suggestions, etc. None of them have
worked. I only get an empty spreadsheet, sometimes with very wide column (I
don't know why).
Almost all examples I have seen involve the use of datasets/datagrids. For
reasons not relevant to the question, I cannot use datagrids for this.
The question is: Can an HTML table be exported or converted to a spreadsheet
directly (or through a routine, whatever)?
Many thanks,
I have a asp.net page that dynamically constructs a table based on data
retrieved from a database. This is an excerpt of the code used:
' Create a row
Dim row As HtmlTableRow = New HtmlTableRow
' Create a column and add it to the row
Dim cell As HtmlTableCell = New HtmlTableCell
cell.InnerText = sValue
row.Cells.Add(cell)
' ... other columns created and added...
tblSummaryTable.Rows.Add(row) ' tblSummaryTable already exists on page,
running at server
' ... loop to add more rows as needed...
Now I need to export this table to a spreadsheet when the user clicks a
button on the page.
I have tried a variety of routines, suggestions, etc. None of them have
worked. I only get an empty spreadsheet, sometimes with very wide column (I
don't know why).
Almost all examples I have seen involve the use of datasets/datagrids. For
reasons not relevant to the question, I cannot use datagrids for this.
The question is: Can an HTML table be exported or converted to a spreadsheet
directly (or through a routine, whatever)?
Many thanks,