I'm exporting an UltraWebGrid to Excel using the Excel Exporter. It works great, but now my customer would like to insert the company logo onto the spreadsheet. Is there any way to do this? I've been looking through the docs and forums and haven't seen anything.
Thanks!Scott
Here is one way you can do this:
I create a workbook then a worksheet. I then load an image then set some positioning properties. You can also use the setBoundsInTwips method as well. I add the image to my worksheet and then export my grid to that worksheet starting at the 10th row.
Can you please help me, how to fix the width and height of image within excel ?. I am trying to use the property 'ws.image.size.width' provided by infragistics. I get an error saying Expression is a value and therefore cannot be the target of an assignment. It will be great if i get an reply regarding this. Thanks.
Try the SetBoundsInTwips method. It expects parameters in twips which is 1/20th of a point.
wsi.SetBoundsInTwips(ws,
new Rectangle(0, 0, 2000, 2000), true);
SetBoundsInTwips documentation:
https://es.infragistics.com/help/winforms/infragistics.documents.excel~infragistics.documents.excel.worksheetimage~setboundsintwips(worksheet,rectangle,boolean)
Hope this will help you.
image.TopLeftCornerCell = theWorkSheet1.Rows[0].Cells[0];
image.BottomRightCornerCell = theWorkSheet1.Rows[4].Cells[1];
theWorkSheet1.Shapes.Add(image);