Discussion:
dBase -> Excel
(too old to reply)
Rick Gearardo
2008-10-29 18:03:27 UTC
Permalink
x = new oleAutoclient("excel.application")
x.workbooks.add()
a = x.activeSheet
r.first()
i = 1
do while .not. r.endOfSet
for c = 1 to r.fields.size
o = a.cells(i,c)
o.formula := r.fields[c].value
next c
i++
r.next()
enddo

Rick
Is it possible to create programmaticaly an excel sheet from a dbase file?
Etienne Gounon
Marc Hamelin
2008-10-29 17:36:44 UTC
Permalink
I believe so, yes... Take a look at ExportData.wfm in the dUFLP by Ken
Mayer.

Marc Hamelin
Geoff Wass [dBVIPS]
2008-10-30 04:45:49 UTC
Permalink
Is it possible to create programmaticaly an excel sheet from a dbase file?
Etienne Gounon
Etienne,

Excel and other spreadsheet programs can read .csv files. You can create
those easily using the following:

use yourTable
copy to c:\yourText.csv type delimited
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
4m
2008-10-31 16:58:42 UTC
Permalink
Thank you all

I will can work fine with all your answers

Etienne
Is it possible to create programmaticaly an excel sheet from a dbase file?
Etienne Gounon
Geoff Wass [dBVIPS]
2008-11-01 05:53:15 UTC
Permalink
Post by 4m
Thank you all
I will can work fine with all your answers
Etienne
Etienne,

You're welcome.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
4m
2008-10-31 18:12:09 UTC
Permalink
Is this running with OpenOffice, and in that case what is oleAutoclient
parameter?

Thanks in advance
Etienne
Post by Rick Gearardo
x = new oleAutoclient("excel.application")
x.workbooks.add()
a = x.activeSheet
r.first()
i = 1
do while .not. r.endOfSet
for c = 1 to r.fields.size
o = a.cells(i,c)
o.formula := r.fields[c].value
next c
i++
r.next()
enddo
Rick
Is it possible to create programmaticaly an excel sheet from a dbase file?
Etienne Gounon
*Lysander*
2008-11-02 16:07:17 UTC
Permalink
Post by 4m
Is this running with OpenOffice
No!
Open office is by far more difficult to access. Their programming model
"UNO" is derived from technologies used in Java languages. While it is a
full blown object oriented model, it is hard to find good documentation.

When I tried, 2 years ago, it was _NOT_ possible at all to program it
from within dBase. The reason was that dBase did not support data of
type "struct", while UNO makes a vast use of this datatype.

Meanwhile, the latest dBase-versions are officially supporting structs,
but I don't know to which extent.
4m
2008-11-02 22:47:45 UTC
Permalink
What a pity!

Thank you
Etienne
Post by *Lysander*
Post by 4m
Is this running with OpenOffice
No!
Open office is by far more difficult to access. Their programming model
"UNO" is derived from technologies used in Java languages. While it is a
full blown object oriented model, it is hard to find good documentation.
When I tried, 2 years ago, it was _NOT_ possible at all to program it from
within dBase. The reason was that dBase did not support data of type
"struct", while UNO makes a vast use of this datatype.
Meanwhile, the latest dBase-versions are officially supporting structs,
but I don't know to which extent.
*Lysander*
2008-11-02 23:28:56 UTC
Permalink
Post by 4m
What a pity!
Yes, that's what I thought as well.
It was one of the reasons I had to keep modules in another programming
language.

Alas, we never fully used office-automation after I finished the
interface, and then we changed again from OpenOffice to MS Office,
because Office2007 is indeed quite good.

Now I could do it all with dBase, but I changed my programming tools in
between.

Loading...