How to insert an image into a cell?

Java, C++, C#, Delphi, ??? - Using the UNO bridges

How to insert an image into a cell?

Postby omurata » Thu Sep 12, 2013 9:42 am

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
omurata
 
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

Re: How to insert an image into a cell?

Postby RoryOF » Thu Sep 12, 2013 9:48 am

This thread suggests it may not be possible
http://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=62586
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29911
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to insert an image into a cell?

Postby omurata » Thu Sep 12, 2013 10:00 am

Thank you for your answer, RoryOF

It is very regret.
OpenOffice 3.4
Windows7 Pro 64bit
omurata
 
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

Re: How to insert an image into a cell?

Postby Zizi64 » Thu Sep 12, 2013 11:45 am

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:
viewtopic.php?f=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; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
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: 8549
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

How to insert an image into a sheet by Java ?

Postby omurata » Thu Sep 12, 2013 12:43 pm

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   Expand viewCollapse view
          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
omurata
 
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am

Re: How to insert an image into a cell?

Postby Zizi64 » Thu Sep 12, 2013 1:27 pm

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; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
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: 8549
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to insert an image into a cell?

Postby Zizi64 » Thu Sep 12, 2013 2:23 pm

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; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
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: 8549
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to insert an image into a cell?

Postby omurata » Thu Sep 12, 2013 2:45 pm

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
omurata
 
Posts: 5
Joined: Thu Sep 12, 2013 9:36 am


Return to External Programs

Who is online

Users browsing this forum: No registered users and 1 guest