OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Java] inserting spreadsheet in word document

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
kirin
General User
General User


Joined: 30 Apr 2007
Posts: 26

PostPosted: Wed Aug 29, 2007 4:10 am    Post subject: [Java] inserting spreadsheet in word document Reply with quote

Hi,
I' don't know where i can post my problem so i try here.

I'm generating very complex document in word format to do that:
-i load a template ( .doc)
-i generate spreadsheet, which i save in excel format (.xls)
- i insert my spreadsheet in my template
- i save my completed document to a word document (.doc)

I activate the conversion option of OOo to convert calc->excel

this work perfectly EXCEPT when i try to edit the spreadsheet in my word document, the OLE object size and position going crazy, the spreadsheet become very small and position can change too.

I made all of this in Java with UNO
The spreadsheet insertion is made by dispathHelper (uno.insertObject), i also try to call a OOo Macro but the result is the same
The spreadsheet is saved in xsl format by using FilterName Ms Excel 97, i also try to save it using the dispatchHelper and uno.saveAs but same problem
i try to insert ods file instead of the xls file , same behavior
i try to protect size, position

I think the problem is that Ms word (.....) don't recognize my xls file ( save as xsl with OOo) as a true xls file so word make strange things with it..

there is something to configure in OOo ? another way to do that ?

so actually my document is ok , but i can"t edit spreadsheet in it

some idea ?

thx
Back to top
View user's profile Send private message
vbms
Power User
Power User


Joined: 13 Aug 2007
Posts: 63

PostPosted: Wed Aug 29, 2007 4:52 am    Post subject: Reply with quote

ok i did the same for a powerpoint a few days ago and also had some similar problems ... by me the spreadsheet cells are real small .. but the actual ole2shape can be sized and positioned with... however i asume there is another size that can be set to make the cell and text size.
Code:

           // create an ole2shape
            XShape oleShape = (XShape)UnoRuntime.queryInterface(XShape.class,
                  xmsf.createInstance("com.sun.star.drawing.OLE2Shape"));
           
            // insert the shape
            oleShape.setPosition(new Point(500,500));
            oleShape.setSize(new Size(27000,20000));
           xShapes.add(oleShape);

please post the code that you are using to size things ...
Back to top
View user's profile Send private message
zombie4004
Newbie
Newbie


Joined: 21 Sep 2010
Posts: 2

PostPosted: Tue Sep 21, 2010 1:21 am    Post subject: Reply with quote

hi ,

I need to implement the same, how did you manage to insert .xls file into a word document. I very need to implement the same in java.

thanks in advance
Back to top
View user's profile Send private message
sanvaan
General User
General User


Joined: 05 Jan 2012
Posts: 13
Location: Bangalore

PostPosted: Sun Mar 11, 2012 11:04 am    Post subject: Reply with quote

i am also stuck with the same problem for 3 days now. can you please post me the java code you used to resolve the issue.

Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group