| View previous topic :: View next topic |
| Author |
Message |
kirin General User

Joined: 30 Apr 2007 Posts: 26
|
Posted: Wed Aug 29, 2007 4:10 am Post subject: [Java] inserting spreadsheet in word document |
|
|
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 |
|
 |
vbms Power User


Joined: 13 Aug 2007 Posts: 63
|
Posted: Wed Aug 29, 2007 4:52 am Post subject: |
|
|
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 |
|
 |
zombie4004 Newbie

Joined: 21 Sep 2010 Posts: 2
|
Posted: Tue Sep 21, 2010 1:21 am Post subject: |
|
|
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 |
|
 |
sanvaan General User

Joined: 05 Jan 2012 Posts: 13 Location: Bangalore
|
Posted: Sun Mar 11, 2012 11:04 am Post subject: |
|
|
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 |
|
 |
|