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,