Solved

Save in Excel

Posted on 2004-09-06
4
1,279 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
proper way to parse url in delphi 2 194
Mobile Keyboard covers the display of the TMemo 3 85
Delphi selector screen 2 78
Delphi 2 59
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

785 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