Solved

How to export records from Tlistview to a HTML format report?

Posted on 2000-04-01
2
151 Views
Last Modified: 2010-04-04
I write a ap. and generate some records
stored in Tlistview, I wonder how to
export these records from Tlistview to
a HTML format report?

Rgds

Chiwan
0
Comment
Question by:chiwan
[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
2 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2676213
How are the record stored?
0
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 2676255
hi,
something like this:

procedure TForm1.Button1Click(Sender: TObject);
var
sl : tstringlist;
i : integer;
begin
sl := tstringlist.create;
sl.add('<HTML>');
sl.add('<HEAD>');
sl.add('<TITLE>');
sl.add('My Report');
sl.add('</TITLE>');
sl.add('</HEAD>');
sl.add('<BODY>');
for i := 0 to listview1.items.Count -1 do
begin
sl.add('<li>' + listview1.Items[i].Caption);
end;
sl.add('</BODY>');
sl.add('</HTML>');
sl.SaveToFile('c:\myreport.html');
sl.free;
sl := nil;
end;
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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