Hello Ximena,

On Tue, Jan 31, 2012 at 12:03:53PM -0400, Ximena Moreta wrote:
>    Good afternoon,
> 
>    Progress4gl work with and I'm doing reports in OpenOffice, where I can
>    find information about the commands for programming in progress with
>    openoffice as:
> 
>    chWorkSheet: getCellByPosition
>    hDesktop: loadComponentFromURL

it looks you're doing something similar to
http://www.oehive.org/files/calcUtils.i.txt

I know nothing about Progress4gl but it looks similar to the ole bridge.

First you have to create the ServiceManager:

CREATE "com.sun.star.ServiceManager" chOpenOffice CONNECT NO-ERROR.

Then use the ServiceManager to instantiate "services", like the Desktop
service com.sun.star.frame.Desktop:

chDesktop = chOpenOffice:createInstance("com.sun.star.frame.Desktop")

This service is documented at
http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/Desktop.html

A service implements interfaces, that define methods (and sometime
attributes). In this case, the Desktop service implements 
* com.sun.star.frame.XDesktop
* com.sun.star.frame.XComponentLoader

This last one is the one that defines the loadComponentFromURL method:
http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/XComponentLoader.html#loadComponentFromURL


So, resuming: find a service documentation and look at the interfaces it
implements. Then invoke this method on the instance you created:

chWorkBook  = chDesktop:loadComponentFromURL("private:factory/scalc","_blank", 
0, cc).


In this case, as you are loading a Spreadsheet document, you get
a com.sun.star.sheet.SpreadsheetDocument
http://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/SpreadsheetDocument.html

You can also search a specific method in the Index: for example, 
getCellByPosition under "G"
http://www.openoffice.org/api/docs/common/ref/index-files/index-7.html
will lead you to 
getCellByPosition() - function in interface ::com::sun::star::table::XCellRange
getCellByPosition() - function in interface 
::com::sun::star::sheet::XCellRangesAccess

...

OpenOffice API is a little complicated, you may find useful reading the
OOo Basic documentation or the Developer's Guide (it has examples in
Java).


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpcYNU0ASfJr.pgp
Description: PGP signature

Reply via email to