Solved

Print a listview

Posted on 2002-04-18
21
540 Views
Last Modified: 2010-04-04
Is there an easy way to print the contents of a listview?
0
Comment
Question by:skynergy
  • 7
  • 7
  • 2
  • +3
21 Comments
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6950977
Hi,

This question was asked a couple of days ago.  See here: http://www.experts-exchange.com/delphi/Q.20289654.html.

It may pay you to "listen" to that thread as well.

Stu
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6951390
it was about printing a treeview but the basic code is still the same :)
0
 
LVL 9

Accepted Solution

by:
ginsonic earned 0 total points
ID: 6951407
procedure TForm1.Button1Click(Sender: TObject);
var
  bmp: TBitmap;
begin
  bmp:= Tbitmap.Create;
  try
    bmp.width := listview1.width;
    bmp.height := listview1.height;
    with bmp.canvas do
    begin
      Lock;
      try
        listview1.perform( WM_PRINT, handle, PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT or PRF_ERASEBKGND );
      finally
        Unlock
      end;
      image1.picture.bitmap := bmp;
    end;
  finally
    bmp.free
  end;
end;
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 9

Expert Comment

by:ginsonic
ID: 6951418
... print the bitmap as device-independent bitmap
0
 

Author Comment

by:skynergy
ID: 6959308
On the "listview1.perform( WM_PRINT, handle, PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT or PRF_ERASEBKGND);" I get a Range Check Error, any comments? Thanx for the help sofar!
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6960354
I have tested the code and for me work perfect . Wish you to send a sample project ?
0
 

Author Comment

by:skynergy
ID: 6968340
I am looking for an alternate way to do this. I don't want to "screen" print the listview. Does anyone have another metod please. Thanx in advance.
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6968578
ummm what do you want ? the last post is a bit unclear
0
 

Author Comment

by:skynergy
ID: 6970582
I was looking more like having a print preview and then the user can print it. Like using quick reports but I am not sure if you could use a listview with them.
0
 

Author Comment

by:skynergy
ID: 6970787
Greatis Print Suite v.1.52 "http://www.greatis.com" looks like a nice component suite for printing almost anything.

PrintDAT! v.1.58e "http://www.grebarsys.com/" also looks quite cool but so pricy!

I am looking for what they offer but just for a listview really. The Greatis ListView Component only supports the Delphi TListView. So it's a bit limiting. I'm still waiting for the other author to comment if his does or not.

So if this gives you guys more info about what I'm looking for I would still apreciate some feedback if someone knows of a simple ListView Printing Component with a previewer if possible. Thanx!
0
 

Author Comment

by:skynergy
ID: 6970790
I think I should motivate a little bit more.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6972809
Whay don't use my idea ? You can display very easy the bitmap into a 'preview' form . Can magnify or minimize it .

I wish to say that almost all reports use for their preview windows an image . Take a look to quick or fuzzy reports .
0
 

Author Comment

by:skynergy
ID: 6972889
Hi ginsonic. The problem with your's is that I am using TdfsExtListView and then I get the following error:
On the "listview1.perform( WM_PRINT, handle, PRF_CHILDREN or PRF_CLIENT or PRF_NONCLIENT or PRF_ERASEBKGND);"
I get a Range Check Error.

So if we can sort that out then I will follow your idea to previewing it as an image. Actually sounds very viable to me now. I just need you to help me on this one please.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6974537
From where can I download a TdfsExtListView vcl ?
I don't have it and to see what is wrong . I think that the problem is in TdfsExtListView component .

Nick

BTW , TdfsExtListView come with source code ?
0
 

Author Comment

by:skynergy
ID: 6974571
You can find it at "http://www.torry.net/vcl/packs/interfacemiddle/dfs.zip" or go to www.torry.ru and search for the component.

Yes, it's free and the source is included.

Thanx Nick ;-)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6975518
This question is current, others below are not.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20185434.html
http://www.experts-exchange.com/questions/Q.20214629.html
http://www.experts-exchange.com/questions/Q.20293277.html
http://www.experts-exchange.com/questions/Q.20290924.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @14 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9003552
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from ginsonic

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 9055118
And where are my points ? I still have just 280 points for this month.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 9057102
Yes, thanks again for support!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 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