ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-03-25 19:07:53

kwebster
Member
Registered: 2016-03-21
Posts: 9

V1.2.2.0 - Saving Image Cell to XLSX

I'm probably doing this wrong, but it has me stumped.

I add an image to an ImageCell which is a 5x2 merged cell. Image displays perfectly in grid control, but does not save to XLSX file. Cell is there, but blank.

Am I missing a step?

Me.GC1.CurrentWorksheet.MergeRange(0, 0, 5, 2)     ' build merged cell for logo
LOGO = CType(My.Resources.SDS, Image)               ' load logo into image
Me.GC1.CurrentWorksheet(0, 0) = New unvell.ReoGrid.CellTypes.ImageCell(LOGO, CellTypes.ImageCellViewMode.Zoom)      ' put logo into cell
Me.GC1.CurrentWorksheet.Cells(0, 0).Style.HAlign = ReoGridHorAlign.Center    ' alignment
Me.GC1.CurrentWorksheet.Cells(0, 0).Style.VAlign = ReoGridVerAlign.Middle

Thanks in advance.


Never order the french onion soup in a Chinese restaurant.

Offline

#2 2016-03-25 21:02:30

alexeyrlx
Moderator
From: CIS
Registered: 2015-07-14
Posts: 36
Website

Re: V1.2.2.0 - Saving Image Cell to XLSX

kwebster, the code can be a little easier:

        Me.GC1.CurrentWorksheet.MergeRange(0, 0, 5, 2)     ' build merged cell for logo
        Me.GC1.CurrentWorksheet(0, 0) = New ImageCell(My.Resources.photo, ImageCellViewMode.Zoom)
        Me.GC1.CurrentWorksheet.Cells(0, 0).Style.HAlign = ReoGridHorAlign.Center    ' alignment
        Me.GC1.CurrentWorksheet.Cells(0, 0).Style.VAlign = ReoGridVerAlign.Middle

        GC1.Save(Application.StartupPath & "\t1.xlsx", IO.FileFormat.Excel2007)

But I had such a mistake
The error is retained even if the cell with address 0.0 is  a single (without merging cells)

error_image_cell.png


We must await the decision of the component developers.

Last edited by alexeyrlx (2016-03-25 21:04:57)


My English is perfect! (My version of the English language ;-) )

Offline

#3 2016-03-26 00:47:55

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: V1.2.2.0 - Saving Image Cell to XLSX

Thanks Alexey.

Hi Kwebster, ImageCell is a feature that only works in ReoGrid, Excel doesn't support that put images into cells.

For export to Excel you have to use floating images, floating images is supported by ReoGrid Pro.
https://reogrid.net/document/floating-image

Offline

#4 2016-03-28 15:38:30

kwebster
Member
Registered: 2016-03-21
Posts: 9

Re: V1.2.2.0 - Saving Image Cell to XLSX

I like solving problems with the boss's credit card. Bought the Pro version and it works.

Floating images seem to be a lot more flexible anyway.


Never order the french onion soup in a Chinese restaurant.

Offline

#5 2016-03-29 01:17:00

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: V1.2.2.0 - Saving Image Cell to XLSX

Glad to hear that!

If you have other problems, questions and suggestions,  feel free to post here or contact the support desk.

Offline

Board footer

Powered by FluxBB