Solved

Save in Excel

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now