We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Images/pictures in WebWorksheets

Hello there!

First of all, excelent work, you guys! This is a realy great tool. Keep up the good work.

I’m trying to use the WebWorksheet to show an Excel file that the user can import, but I can’t seem to find a way to show the pictures that are embedded in the xls file. I can manipulate them with the regular worksheet class, but not with the WebWorksheet because it does not have a Pictures container like the worksheet class. Is there a workaround available or something else that allows me to at least show the pictures in the Form?

Thanks in advance!

Hi,

Thanks for considering Aspose.

I think you are talking about Aspose.Grid.Web (GridWeb Control), Well, when you import an excel file into the gridweb control, the pictures are not imported with the excel file. We are working on it and hopefully we will support this feature soon. Currently you may add pictures through image hyperlink at runtime only. See the code snippet below:

//Adds an image hyperlink on B6 cell.
Hyperlink linkOfImage1 = GridWeb1.WebWorksheets[0].Hyperlinks.AddHyperlink("B6");
linkOfImage1.ImageUrl = "../style/Aspose.Banner.gif";
.
.
.
.
For further ref, please check the source code of Hyperlink demo in our featured Aspose.Grid.Web.Demos.
Thank you.

Hum, ok, that might do the trick. Didn’t thought of it.

Thanks again for this quick response!

Best regards

Hello again,

I’m messing around with the GridWeb control, and I was trying to add images to the cells. I managed to insert an image into a cell using the code GridWeb1.WebWorksheets[0].Cells[1,1].Images.AddCellImage(“B2”).ImageUrl = “…/Images/image.bmp”;

Now I would like to add this image not inside a cell but somehow above a range of cells. I do not need it to be fully floating, like in excel, but i would like the image to spread along a range of cells. My reason: I have this book with charts that I want to preview in the GridWebControl. Since this control doesn’t support chart display, I was thinking of using the chart’s ToImage method, convert it to image and then place the image where the chart was, with its exact size. But to do this I need to spread the chart’s image along the range of cells that the chart occupies, otherwise the cell where I place the image will grow and cause all other cells to shift, thus loosing the original format.

Is there a way to do this?

Thanks,
Cruz

Well, I managed a workaround by merging the cells below the charts and the inserting the chart’s image onto them. Nevertheless, this still changes formats, because the cells don’t exactly finish or start at the chart’s borders, but the change in formats is now much smaller.

However I would still like to know if there is a way to place floating images in the GridWebControl.

Thanks,
Cruz

Hi Cruz,

Thanks for the details and your workaround is fine.

We may consider it and implement in our future versions of Aspose.Grid.Web.

Thank you.