Solved

Save in Excel

Posted on 2004-09-06
4
1,281 Views
Last Modified: 2008-03-06
Hi,

One problem, I want to save my ClientDataSet in .xls File, but I want to save with easy FieldNames .

Example:
  Field "Employee" I want the name "Employee Name" in my Field in Excel.

I was using ADO to create .xls, but the ADO make xls file with FieldNames equal to ClientDataSetNames.


Thank You!!!
0
Comment
Question by:schardosin
4 Comments
 
LVL 11

Accepted Solution

by:
calinutz earned 50 total points
ID: 11989535
You can do whatever you want within the excel sheet:
Check out this example:
var
 i,j:integer;
 WBk: _Workbook;
 Ws: _WorkSheet;
 StartLine:integer;
 Frm:OLEVariant;
begin
StartLine:=10;
XLApp1.Connect;
XLApp1.Visible[0]:=false;
WBk := XLApp1.Workbooks.Add(EmptyParam, 0);
WS := XLApp1.ActiveSheet as _Worksheet;

 WS.Cells.Item[0,0].Value := 'Employee name';
 WS.Cells.Item[0,1].Value := 'Employee address';
 XlApp1.Visible[0]:=true;
end;


The ideea is that you can write anything to the excel worksheet
using:
 WS.Cells.Item[0,0].Value := 'your text';
Of course a dataset it's also easy to export.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 119
Multiple image collision 13 80
How to convert memory stream to PDF file 6 125
How to save the image in the .cds File ClientDataSet? 1 22
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question