How to insert an image into a cell?

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
omurata
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

How to insert an image into a cell?

Post by omurata »

Hello everyone

I know that I use XCell.setFormula() to insert a string into a cell.

Please tell me how to insert an image into a cell.

Best regards
Tadashi Ohmura
OpenOffice 3.4
Windows7 Pro 64bit
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to insert an image into a cell?

Post by RoryOF »

This thread suggests it may not be possible
http://forum.openoffice.org/en/forum/vi ... =9&t=62586
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
omurata
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

Re: How to insert an image into a cell?

Post by omurata »

Thank you for your answer, RoryOF

It is very regret.
OpenOffice 3.4
Windows7 Pro 64bit
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to insert an image into a cell?

Post by Zizi64 »

You can import images into a Calc document by macro code.

See these threads on another Forum:

http://www.oooforum.org/forum/viewtopic.phtml?t=132179
http://www.oooforum.org/forum/viewtopic.phtml?t=178847

and you can align pictures to the cells:
http://forum.openoffice.org/en/forum/vi ... =9&t=34544

Note:
...The images have not stored IN THE CELLS, but they are "stored" in a graphical layer of the sheet.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
omurata
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

How to insert an image into a sheet by Java ?

Post by omurata »

Thank you for your informations.

I have questions about how to insert an image into a sheet by Java.

I try to get com.sun.star.drawing.XDrawPage object :

Code: Select all

          com.sun.star.drawing.XDrawPagesSupplier xDPS =
              (XDrawPagesSupplier) UnoRuntime.queryInterface(
					com.sun.star.drawing.XDrawPagesSupplier.class, xComponent);
          com.sun.star.drawing.XDrawPages xDPn = xDPS.getDrawPages();
          com.sun.star.drawing.XDrawPage xDrawPage = null;
          com.sun.star.container.XIndexAccess xDPi =
              (XIndexAccess) UnoRuntime.queryInterface(
					com.sun.star.container.XIndexAccess.class, xDPn);
          xDrawPage = (XDrawPage) UnoRuntime.queryInterface(
              com.sun.star.drawing.XDrawPage.class, xDPi.getByIndex(0));
Please tell me what do I do next.
OpenOffice 3.4
Windows7 Pro 64bit
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to insert an image into a cell?

Post by Zizi64 »

Sorry,
I am not familiar to Java, I am only familiar to Basic (StarBasic and others; and to Pascal/Delphi and to the Cpp a little bit...)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to insert an image into a cell?

Post by Zizi64 »

Here is a buggy, Java example code posted by 'ssureshkumar', Tue Mar 23, 2010 11:24 pm:

http://www.oooforum.org/forum/viewtopic.phtml?t=66545
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
omurata
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

Re: How to insert an image into a cell?

Post by omurata »

Thank you for your help, Zizi64

It is regret that the code in thread "http://www.oooforum.org/forum/viewtopic.phtml?t=66545" does not work.
OpenOffice 3.4
Windows7 Pro 64bit
Post Reply