Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
Export company Logo
posted

We are using excelexporter version 8.1.

I am able to export company logo into excel worksheet. It is showing up. What I want to know is:

Logo image is of certain size. My excel column 1 is small (account #) and column 2 is long (account Name). When I specify the size of image, I have to give how many cells it needs to be expanded, which makes my image to stretch. If I want it in just column 1, either I have to expand column 1 width or logo will be small. I even tried to merge cells 1, 2 and so that image can fit half of cell 2.

Here is my code:

 

e.CurrentWorksheet.MergedCellsRegions.Add(0, 0, 3,1);

 

 

WorksheetImage wsi = new WorksheetImage(System.Drawing.Image.FromFile(MapPath("~/Image/") + "companylogo275x80.jpg"

));

wsi.TopLeftCornerCell = e.CurrentWorksheet.Rows[0].Cells[0];

wsi.BottomRightCornerCell = e.CurrentWorksheet.Rows[4].Cells[2];

wsi.PositioningMode =

ShapePositioningMode.DontMoveOrSizeWithCells;

e.CurrentWorksheet.Shapes.Add(wsi);

Is there anyway I can retain the original logo size.

I appreciate your response.

Thanks,

katta