Apache OpenOffice (AOO) Bugzilla – Issue 75074
Accessing Spreadsheet through Impress document using OOo API
Last modified: 2013-02-24 21:09:07 UTC
I was wondering if anyone could point me in the right direction. I created an Impress slide template that has several spreadsheets on it. I have written a Java program that I want to accesss and populate the spreadsheets. I am able to access the spreadsheets as draw objects but I cannot find a way to access the individual cells inside the spreadsheets. Here is a sample of my code: XMultiServiceFactory xFactory = (XMultiServiceFactory )UnoRuntime.queryInterface( XMultiServiceFactory.class, xLoadDocument ); XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier)UnoRuntime.queryInterface( XDrawPagesSupplier.class, xLoadDocument ); XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages(); XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xDrawPages.getByIndex( 0 )); XSpreadsheetDocument firstDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface(XSpreadsheetDocument.class, xDrawPage.getByIndex(0)); XSpreadsheets xSpreadsheets = firstDoc.getSheets(); XIndexAccess xSheetIndexAccess = (XIndexAccess)UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheets xSpreadsheets = (XSpreadsheets)UnoRuntime.queryInterface (XSpreadsheets.class,xDrawPage.getByIndex(0)); Object sheet1 = xSpreadsheets.getByName("Sheet1"); XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(XSpreadsheet.class, sheet1); XCell xCell = xSpreadsheet.getCellByPosition(0,0); Thx...
Another method that I was trying to extract the embedded object out of Impress Document was enumerate through the shapes by using createEnumeration(). I saw several examples from the issues database of how to extract data out of a TextDocument but not Impress Document. The big difference is that I am not sure at what level(container--XDrawPagesSupplier, or XDrawPages, or just XDrawPage) of the document to createEnumeration on.
Hi Sailor :-) Issutracker is not for Anwers & Questions. You can use the OOoForum.org or dev@api.openoffice.org. Futhermore: sorry I can't answer your question directly. But sure the SDK on http://api.openoffice.org will hold the answer to at least your second question. (Since I mainly work with OOoBasic, I use XRay for investiagations.) Cheers, Cor
cornouws has already mentioned that the issue trcker is not asking questions. Sorry but this is an invalid task, please use the mailing list.
closed