Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-11

New Excel Interface Component

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thierry Coq

using the DISPID features of FPC and the Lazarus environment, I have started to write an Excel Interface component.

Excel workbooks and sheets can be created, opened and saved. Cell values can be read and updated. Cell color can be modified. For performance DISPID identifiers are used, reducing overhead. Not all properties and operations have been implemented yet. All complicated calls to Dispatch.Invoke have been encapsulated to make it easy to use. See the test program (made with FPCUnit) to see how easy.

It can be downloaded here: http://tcoq.free.fr/composants.html

a direct link to the source code :
http://www.tcoq.free.fr/ExcelInterface-Sources%20V0.1.tar.gz

All comments and improvements are welcome.

Enjoy!

Thierry Coq

Reply by email

Henrique Faria
to Thierry Coq

Very good. What about something to OpenOffice?

Henrique.> Date: Sat, 8 Nov 2008 15:53:17 +0100> From: > To: > Subject: [Lazarus] New Excel Interface Component> > using the DISPID features of FPC and the Lazarus environment, I have > started to write an Excel Interface component.> > Excel workbooks and sheets can be created, opened and saved. Cell values > can be read and updated. Cell color can be modified.> For performance DISPID identifiers are used, reducing overhead.> Not all properties and operations have been implemented yet.> All complicated calls to Dispatch.Invoke have been encapsulated to make > it easy to use. See the test program (made with FPCUnit) to see how easy.> > It can be downloaded here: http://tcoq.free.fr/composants.html> > a direct link to the source code : > http://www.tcoq.free.fr/ExcelInterface-Sources%20V0.1.tar.gz> > All comments and improvements are welcome.> > Enjoy!> > Thierry Coq> _______________________________________________> Lazarus mailing list> > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus _________________________________________________________________ Instale a Barra de Ferramentas com Desktop Search e ganhe EMOTICONS para o Messenger! ? GR?TIS! http://www.msn.com.br/emoticonpack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081109/1899eebe/attachment.html

Reply by email

Luiz Americo Pereira Camara
to Henrique Faria
Henrique Faria wrote
Very good. What about something to OpenOffice?

It seems fpc OLE support is not good enough to work with OO.

Attached are a Lazarus project and a Delphi project that converts a OO document to pdf. Both shares the same unit (OOPdf) and have the same logic.

Delphi version works OK. Lazarus one crashes.

Using:
Lazarus 0.9.27 + fpc 222
TurboDelphi

Luiz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OOAutomation.zip
Type: application/zip
Size: 9494 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081109/0330890b/attachment.zip

Reply by email

Thierry Coq
to Luiz Americo Pereira Camara: It seems fpc OLE support is not good enough to work with OO. Attached are a Lazarus…

It may be the same problem I encountered on the Excel translation: Delphi understands DISPID interfaces, while FPC doesn't entirely, for the moment.

Using the manner in which ExcelInterface manages DISPID could be a good way to do the same thing for OOO.

I'll give it a thought.

Thierry Coq

Luiz Americo Pereira Camara wrote 24 lines
Henrique Faria escreveu: > Very good. What about something to OpenOffice? > It seems fpc OLE support is not good enough to work with OO. Attached are a Lazarus project and a Delphi project that converts a OO document to pdf. Both shares the same unit (OOPdf) and have the same logic. Delphi version works OK. Lazarus one crashes. Using: Lazarus 0.9.27 + fpc 222 TurboDelphi Luiz ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Thierry Coq
to Luiz Americo Pereira Camara: It seems fpc OLE support is not good enough to work with OO. Attached are a Lazarus…

Yes, definitively,

I've checked, this code seems to be currently geared to use DISPID interfaces. This works in Delphi, but not in FPC for the time being.

For example, the following code:
   fDocument := fDesktop.loadComponentFromURL('file:///'+
StringReplace(FileName, '\', '/', [rfIgnoreCase, rfReplaceAll]) ,
'_blank', 0, wProperties);

declares fDocument as an OleVariant. The author hopefully expects FPC to understand how to go and fetch "loadComponentFromURL". It ain't gonna work ;-).

It should be done this way:
   var fDocument : IDispatch;
   ...
   fDocument.InvokeDispatch( DISPID_LOADCOMPONENTFROMURL, ...);

Thierry Coq

Luiz Americo Pereira Camara wrote 24 lines
Henrique Faria escreveu: > Very good. What about something to OpenOffice? > It seems fpc OLE support is not good enough to work with OO. Attached are a Lazarus project and a Delphi project that converts a OO document to pdf. Both shares the same unit (OOPdf) and have the same logic. Delphi version works OK. Lazarus one crashes. Using: Lazarus 0.9.27 + fpc 222 TurboDelphi Luiz ------------------------------------------------------------------------ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Luiz Americo Pereira Camara
to Thierry Coq
Thierry Coq wrote 21 lines
Yes, definitively, I've checked, this code seems to be currently geared to use DISPID interfaces. This works in Delphi, but not in FPC for the time being. For example, the following code: fDocument := fDesktop.loadComponentFromURL('file:///'+ StringReplace(FileName, '\', '/', [rfIgnoreCase, rfReplaceAll]) , '_blank', 0, wProperties); declares fDocument as an OleVariant. The author hopefully expects FPC to understand how to go and fetch "loadComponentFromURL". It ain't gonna work ;-). It should be done this way: var fDocument : IDispatch; ... fDocument.InvokeDispatch( DISPID_LOADCOMPONENTFROMURL, ...); Thierry Coq

I tried to download your component to see the implementation but i'm getting "Page not found" message for both packages (binary and src) Can you take a look at it?

Luiz

Reply by email

Alex du Plessis
to Thierry Coq: using the DISPID features of FPC and the Lazarus environment, I have started to write an…
Thierry Coq wrote 20 lines
using the DISPID features of FPC and the Lazarus environment, I have started to write an Excel Interface component. Excel workbooks and sheets can be created, opened and saved. Cell values can be read and updated. Cell color can be modified. For performance DISPID identifiers are used, reducing overhead. Not all properties and operations have been implemented yet. All complicated calls to Dispatch.Invoke have been encapsulated to make it easy to use. See the test program (made with FPCUnit) to see how easy. It can be downloaded here: http://tcoq.free.fr/composants.html a direct link to the source code : http://www.tcoq.free.fr/ExcelInterface-Sources%20V0.1.tar.gz All comments and improvements are welcome. Enjoy! Thierry Coq

I agree - I also get a "Page not found" error when I try the link to the component. The link from your page also gives the same error.

Alex du Plessis

Reply by email

Thierry Coq
to Luiz Americo Pereira Camara: I tried to download your component to see the implementation but i'm getting "Page not…

Link should be fixed now.

Luiz Americo Pereira Camara wrote 37 lines
Thierry Coq escreveu: > Yes, definitively, > > I've checked, this code seems to be currently geared to use DISPID > interfaces. This works in Delphi, but not in FPC for the time being. > > For example, the following code: > fDocument := fDesktop.loadComponentFromURL('file:///'+ > StringReplace(FileName, '\', '/', [rfIgnoreCase, rfReplaceAll]) , > '_blank', 0, wProperties); > > declares fDocument as an OleVariant. The author hopefully expects FPC to > understand how to go and fetch "loadComponentFromURL". It ain't gonna > work ;-). > > It should be done this way: > var fDocument : IDispatch; > ... > fDocument.InvokeDispatch( DISPID_LOADCOMPONENTFROMURL, ...); > > Thierry Coq > > I tried to download your component to see the implementation but i'm getting "Page not found" message for both packages (binary and src) Can you take a look at it? Luiz _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Henrique Faria

H?ctor.

Actually, i just tested the test bin and it opened excel, so i realized it's good. It was a quick look. I think you should ask Thierry for details.

Henrique.

From: : : New Excel Interface ComponentDate: Sun, 9 Nov 2008 11:21:55 -0500

Dear Faria:

I have received this product but I am afraid of not be so smart to test it.

if you can give me some tips I will thanks to you, maybe in spanish

yours,

Ing. H?ctor F.
_________________________________________________________________ Confira v?deos com not?cias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video! http://video.msn.com/?mkt=pt-br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081109/cd44abf8/attachment.html

Reply by email