Javascript Error in Export to Excel

Hi Support Team,

I am getting following error in IE 8. Kindly help me on this urgently.

(a) ‘type’ is null or not an object
(b) ‘undefined’ is null or not an object.

Please find the attached screenshot of screen and debug information, we have Telerik Rad grid and DataTable, we are trying to export to excel (cells) from datatable.

Javascript Error_1.jpg
Javascript Error_3.jpg
Javascript Error.jpg


CODE:


ws = wb.Worksheets[0];

ws.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA4Rotated;
ws.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Landscape;
for (int i = 0; i < dt.Columns.Count; i++)
{
// Add the header the first time through
ws.Cells[0, i].Value = Convert.ToString(dt.Columns[i].ColumnName);
}
Aspose.Cells.Style style2 = new Aspose.Cells.Style();
foreach (System.Data.DataRow drRow in dt.Rows)
{
rowCount += 1;
for (int i = 0; i < dt.Columns.Count; i++)
{
string strRowData = string.Empty;
double strRowData1 = 0;
if ((dt.Columns[“Score”] != null && i == 3) || (dt.Columns[“Benchmark Score”] != null && i == 2))
{
strRowData1 = drRow[i] == string.Empty ? 0.00 : Convert.ToDouble(drRow[i]) / 100;
ws.Cells[rowCount, i].Value = strRowData1;
style2 = ws.Cells[rowCount, i].GetStyle();
style2.Number = 9;
ws.Cells[rowCount, i].SetStyle(style2);
}
else
{
strRowData = Convert.ToString(drRow[i]);
ws.Cells[rowCount, i].Value = strRowData;
}
}
}
ws.AutoFitColumns();
ws.AutoFitRows();

Aspose.Cells.Style style = new Aspose.Cells.Style();
style.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Center;
style.VerticalAlignment = Aspose.Cells.TextAlignmentType.Center;
Aspose.Cells.StyleFlag sfalg = new Aspose.Cells.StyleFlag();
sfalg.HorizontalAlignment = true;
ws.Cells.ApplyStyle(style, sfalg);

Aspose.Cells.Style style1 = new Aspose.Cells.Style();
style1.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Left;
style1.VerticalAlignment = Aspose.Cells.TextAlignmentType.Center;
Aspose.Cells.StyleFlag sfalg1 = new Aspose.Cells.StyleFlag();
sfalg1.HorizontalAlignment = true;
ws.Cells.ApplyColumnStyle(0, style1, sfalg1);

wb.Save(this.Response, “PReporting.xls”, Aspose.Cells.ContentDisposition.Inline, new Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003));

Thanks,
Nagamani.

Hi,


We could not trace your issue based on your screen shots you attached.

Since you are also using Telerik RAD grid control in your project for which we are not sure about the issue. Please do separate the issue regarding Aspose.Cells component only and create a sample project/application (runnable) (without using Telerik RAD control or its APIs), zip the project to share it here. We will check your issue soon.

Just for your knowledge, Aspose.Cells is an Excel file creation, manipulation or conversion library, we are responsible for the issues that may occur in reading/generating Excel files using Aspose.Cells APIs. The Excel files that are generated by Aspose.Cells product should be opened fine in MS Excel/Excel Viewer. If any file is not opened fine or displayed fine in Excel viewer or MS Excel, we are bound to fix the issue as soon as possible because we follow MS Excel standards only. But, for any other third part component/control, if it does not display or read/write file that is generated by Aspose.Cells, I am afraid, we may not be of much help (you should ask your other third party vendor to fix the issue) here.

Also, we recommend you kindly try our latest fix: Aspose.Cells for .NET v7.2.2.7

Thank you.