Query Regarding Aspose Cells-

Hi,

I am Using The Aspose Cells Component with Latest Version Of 4.6.0.0.
I have the DataTable Of More Than 256 Columns.I need to Load this DataTable Into Excel. As of present it is not working.
Any Solution For This will be a great help.

Regards,

R.Raghavendra Prasanna
Arcadix Infotech Private Limited,
#2B, 5/1 RichHomes,
RichmondRoad,
Bangalore 560025


This message was posted using Email2Forum by Amjad Sahi.
Hi,
Thanks for your inquiry.

Well, MS Excel (97-2003) only has 256 columns (A-IV), so you can filled only 256 columns in xls file format. Please use xlsx file format (MS Excel 2007) to save your excel file after loading your dataset into the sheet to cross this limit.

I have written a sample code using the version v4.7.0.7 (please download it @: http://www.aspose.com/community/forums/170985/query-regarding-maximum-number-of-columns-supported/showthread.aspx#170985 ) as it works fine.

Sample code:

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

DataTable dataTable1 = new DataTable();
for (int i = 0; i < 360; i++)
{
dataTable1.Columns.Add("AsposeTest" + i.ToString());
}
for (int i = 0; i <= 10; i++)
{
DataRow dr = dataTable1.NewRow();
for (int j = 0; j < 360; j++)
{
dr[j] = "AsposeTest" + j.ToString();
}
dataTable1.Rows.Add(dr);
}
sheet.Cells.ImportDataTable(dataTable1, true, "A1");
workbook.Save("F:\\test\\outBook.xlsx");

Thank you.