Post
by Klaus-Dieter Remmler » 28 May 2003, 12:05
Posted by: kdre...@boerner-web.de (Klaus-Dieter Remmler)
Hallo,
there are several ways to do the job:
1. .csv files created by the application and given to Excel
Only text data can be safely transformed. Special formats like
date/time values or numbers must converted, that Excel can understand
the data. NULLs in the first rows are not so good, because Excel
converts them into empty strings.
2. Using the OLE-interface of Excel
In CTD 1.5 or higher you can generate functional classes that
represent Excel objects. Your applications grows, but it is a very
easy way to transfer data between Centura and Excel. To do the job,
you must know the OLE-Interface of Excel (as described in the VBA
documentation and used with VBS).
3. DDE with Excel
Not a so good idea, because it is an old interface and not supported
by the newer versions of CTD (CTD 2000 or higher a think). DDE is very
slow and depends on the version of Excel you are using.
4. Script technologies (our way to do the job)
Our CTD application (CTD 1.1 or higher) writes a XML-parameter file
that contains all necessary informations (e.g. connection data, query,
app, module, version, user parameters etc.). The applications calls a
script file (e.g. VBS file) and this file does the job using the
OLE-interface. The parameter file is given to the script and
interpreted by the script.
The script connects with the database, obtains the data and transfers
the data into Excel spreadsheet. All necessary data conversions can be
done in the script. I think it is the most flexible way to do the job.
Our actual implmentation uses classes to manage the basic works and
special functional classes in our apps to manage the special things of
the app.
Hope it helps
Greetings from Germany
Dr. Klaus-Dieter Remmler