Solved

Save in Excel

Posted on 2004-09-06
4
1,285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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 Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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