Using Open Office

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Using Open Office

Post by sudip »

Hi All,

Is there any way to use Open Office Apps, eg., Calc instead of Excel from HMG.

A discussion regarding this topic will be great helpful for all who are using Open Source Software :-)

Thank you in advace :-)

Regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Using Open Office

Post by Rathinagiri »

Hi,

I use 95% of open source products including OpenOffice. I would list them, in a short while.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Using Open Office

Post by mol »

I have a pattern to write to open office calc. I will find it later and put on the forum. (I saved it on one of my computers and don't know on which... :-))
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Using Open Office

Post by mol »

I found that example!!!
It really works!
i don't know, who is author, but regards to him.
It also contains sample to create PDF, but something is wrong with aligning in PDF document.
MiTPRINTOv23.zip
(34.02 KiB) Downloaded 381 times
User avatar
gfilatov
Posts: 1069
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Using Open Office

Post by gfilatov »

mol wrote:...
i don't know, who is author, but regards to him.
Hello Mol,

The homepage of MiTPRINTO v2.3 for HMG is
http://www.embalajesterra.com/misdoc/pr ... ramas.html
:idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Using Open Office

Post by mol »

of course, Grigory!
I found it during looking patterns with Excel.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Using Open Office

Post by Rathinagiri »

Thanks for the file and the link Mol and Filatov..
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Using Open Office

Post by sudip »

Hello Mareck, Grigory,

Thanks a lot :)

Sorry for my delayed response :( (My net connection was out of order for some hours)

Regards.

Sudip
With best regards,
Sudip
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Using Open Office

Post by sudip »

Hi,

Today, another friend, Antonio searched for the same topic in another group (xHarbour group).

I hope this mail will be helpful for all :)
Antonio wrote:Sudip,

To seems AutomateIt program (OLE conversor) not running; i obtain a Run time
error at worksheets in

oExcel:CreateObject("Excel.Application")
oExcel:WorkSheets:Count // here RTE

I'm developmeting a layer for to use OLE Calc throw OLE Excel syntax.
I don´t know if this option it's the better ???
Initial layer's code:

Code: Select all

#Define lSISTEMA_CALC .T.
//--------------------------------------------------------------------------
//
FUNCTION CreateObjectExcelLayer()
Local oExcel:= NIL
Local oErr:= NIL
IF !lSISTEMA_CALC
   TRY
       // Siempre crea objeto (evito algunos problemas pe. en saveas())
       oExcel:= CreateObject( "Excel.Application" )
   CATCH oErr
       MERROR_( "­ No se pudo conectar con Excel !", OLE2TXTERROR(),
oExcel,;
                oErr:SubSystem(),;
                oErr:Description,;
                oErr:Operation )
       oExcel:= NIL
   END
ELSE
   oExcel:= TExcelLayer():New()
ENDIF
RETURN oExcel
*
//--------------------------------------------------------------------------
//
CLASS TExcelLayer
  METHOD New()
//  ASSIGN Visible(x) INLINE (msginfo("hola", x))
  METHOD Get(cMessage) //INLINE msginfo(cMessage, "falta implementar !")

  // Datas Excel simuladas ----------------------------------------
  // Estas datas seran las que se manjen desde fuera... pero aqui
  // dentro deben tener valores apropiados
  DATA oSheet
  DATA WorkBooks
  DATA TmpWorkSheets        HIDDEN
  METHOD WorkSheets(nSheet)
  #Define ACTIVE_SHEET ::oOOCalc:getCurrentController():getActiveSheet()
  ACCESS ActiveSheet INLINE TWorkSheetExcelLayer():New(Self, NIL, NIL,
ACTIVE_SHEET)
  //---------------------------------------------------------------
  // Datas Calc reales --------------------------------------------
     DATA oOOEngine         READONLY
     DATA oOOCore           READONLY
     DATA oOODesktop        READONLY
     DATA oOOCalc           READONLY
  //---------------------------------------------------------------
ENDCLASS
*
//--------------------------------------------------------------------------
//
METHOD WorkSheets(nSheet)
Local xRet:= NIL
#Define lCOMO_DATA PCount() == 0
IF lCOMO_DATA
   xRet:= ::TmpWorkSheets
ELSE
   xRet:= TWorkSheetExcelLayer():New(Self, NIL, nSheet- 1)
ENDIF
RETURN xRet
//--------------------------------------------------------------------------
//
METHOD Get(cMessage)
cMessage:= Upper(cMessage)
DO CASE
   CASE cMessage == "ACTIVESHEET"
      xRet:= ::ActiveSheet
      *
   CASE .T.
      MERROR_("Falta implementar mensaje", cMessage)
ENDCASE
RETURN xRet
*
//--------------------------------------------------------------------------
//
METHOD New() CLASS TExcelLayer
Local oErr
*
TRY
    ::oOOEngine:= CreateObject( "com.sun.star.ServiceManager" )
CATCH oErr
    MERROR_( "­ No se pudo conectar con Open Office !", OLE2TXTERROR(),
::oOOEngine,;
             oErr:SubSystem(),;
             oErr:Description,;
             oErr:Operation )
    RETURN NIL
END
::oOOcore   :=
::oOOEngine:CreateInstance("com.sun.star.refelection.CoreReflection")
::oOODesktop := ::oOOEngine:createInstance("com.sun.star.frame.Desktop")
*
::oOOCalc := ::oOODesktop:loadComponentFromURL("private:factory/scalc",
"_blank", 0, {})
::WorkBooks := TWorkBooksExcelLayer():New(Self)
::TmpWorkSheets:= TWorkSheetsExcelLayer():New(Self)
RETURN Self
*
*
*
//--------------------------------------------------------------------------
//
//--------------------------------------------------------------------------
//
CLASS TWorkBooksExcelLayer

   EXPORTED:
      METHOD New()
      METHOD Add()
   HIDDEN:
      DATA oExcelLayer
ENDCLASS
//--------------------------------------------------------------------------
//
METHOD New(oExcelLayer) CLASS TWorkBooksExcelLayer
::oExcelLayer:= oExcelLayer
RETURN Self
//--------------------------------------------------------------------------
//
METHOD Add() CLASS TWorkBooksExcelLayer
Local oBook
oBook:= TWorkBookExcelLayer():New(::oExcelLayer) //, Self)
RETURN oBook
//--------------------------------------------------------------------------
//
CLASS TWorkBookExcelLayer
   EXPORTED:
      METHOD New()
   HIDDEN:
      DATA oExcelLayer
      DATA oWorkBooksExcelLayer
ENDCLASS
//--------------------------------------------------------------------------
//
METHOD New(oExcelLayer, oWorkBooksExcelLayer) CLASS TWorkBookExcelLayer
::oExcelLayer         := oExcelLayer
::oWorkBooksExcelLayer:= oWorkBooksExcelLayer
RETURN Self

//--------------------------------------------------------------------------
//
CLASS TWorkSheetsExcelLayer

   EXPORTED:
      METHOD New()
//      // -1 pq parece que indica una hoja mas de la cuenta !!!
//      ACCESS Count  INLINE Len( ::oExcelLayer:oOOCalc:getSheets() )- 1
      ACCESS Count  INLINE ::oExcelLayer:oOOCalc:getSheets():getCount()
   HIDDEN:
      DATA oExcelLayer
ENDCLASS
//--------------------------------------------------------------------------
//
METHOD New(oExcelLayer) CLASS TWorkSheetsExcelLayer
::oExcelLayer:= oExcelLayer
RETURN Self
*
//--------------------------------------------------------------------------
//
CLASS TWorkSheetExcelLayer
   EXPORTED:
      METHOD New()
      METHOD Delete() INLINE
::oExcelLayer:oOOCalc:getSheets():removeByName(::oOOSheet:Name  )
      ACCESS Name        INLINE ::oOOSheet:Name
      ASSIGN Name(cName) INLINE ::oOOSheet:Name:= cName
   HIDDEN:
      DATA oExcelLayer
      DATA oWorkSheetsExcelLayer
      DATA nSheet
      DATA oOOSheet
ENDCLASS
//--------------------------------------------------------------------------
//
METHOD New(oExcelLayer, oWorkSheetsExcelLayer, nSheet, oOOSheet) CLASS
TWorkSheetExcelLayer
::oExcelLayer          := oExcelLayer
::oWorkSheetsExcelLayer:= oWorkSheetsExcelLayer
::nSheet               := nSheet
DO CASE
   CASE ::nSheet != NIL
      ::oOOSheet:= ::oExcelLayer:oOOCalc:getSheets():getByIndex(nSheet)
   CASE oOOSheet != NIL
      ::oOOSheet:= oOOSheet
ENDCASE
RETURN Self 
Regards.

Sudip
With best regards,
Sudip
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Using Open Office

Post by sudip »

Hi,

I also got some information regarding OpenOffice from another group

Using OpenOffice Calc with MiniGui
http://www.embalajesterra.com/misdoc/ma ... fice1.html

Using OpenOffice Write with MiniGui
http://www.embalajesterra.com/misdoc/ma ... fice2.html

Thank you all.

With best regards.

Sudip
With best regards,
Sudip
Post Reply