Populate Aspose.cells Worksheet from Tablecontrol

Hello Team,

I have a table control (asp:table) which is getting populated through my code. Using the populated tablecontrol, I want to create a excel worksheet.

Below is my code:
foreach (DataRow dr in ds.Tables[0].Rows)
{
TableRow tr = new TableRow();
tr.Cells.Add(GetRecordCell(“2012”));
tr.Cells.Add(GetRecordCell(dr[“Emplid”]));
tblResults.Rows.Add(tr);
}

In the above code, tblResults in the tablecontrol. Could you please help me in using the data in the tblResults to populate a worksheet?

Thanks,

Hi,


Aspose.Cells provide a few means to import data from variety of data sources, including DataTable, DataRow, DataColumn, Arrays, List etc. I think you may try to import your source DataTable (for your table control) using Cells.ImportDataTable method provided by Aspose.Cells for .NET. This is an efficient method that can import huge data table to fill all the data in the worksheet cells quickly.

See the topic for your complete reference:
http://www.aspose.com/docs/display/cellsnet/Importing+Data+to+Worksheets