I have an existing web Ultragrid which works fine. I'm simply trying to put an image on top of Excel sheet on Export event by trying to write the image directly on first index Rows[0].Cells[0] and whenever I do that, it throws "...is not a supported cell value type."
The code I try
protected void exportControl_ExportXLS(object sender, EventArgs e) {
Workbook wb = new Workbook(); Worksheet ws = wb.Worksheets.Add("my Title"); WorksheetCell wc = ws.Rows[0].Cells[0]; System.Drawing.Image logo = System.Drawing.Image.FromFile(Server.MapPath("~/logo.jpg")); wc.Value = logo; // DOESNT WORK. I need an Image on this cell.
exportControl.XLSExport.Export(MyGrid.grid1, ws, 2, 0); // this part exported the grid fine
}
I Tried to set the cell value to Bitmap/JPEG object with same result. I read somewhere that I should use Appeareance.backgroundImage but the cell does not have this property..
Worksheet.Rows[0].Cells[0]....
I know this is very trivial but I'm stuck and would really appreciate any pointer. Thanks..
So I just see that the cell value does not accepting image. So simply, how do I insert the image to a cell?
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2012.2/CLR4.0/html/Infragistics4.WebUI.Documents.Excel.v12.2~Infragistics.Documents.Excel.WorksheetCell~Value.html
nvm. Found what i need.
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/ExcelEngine_Add_an_Image_to_a_Worksheet.html