Click here to Skip to main content
15,881,380 members
Articles / Programming Languages / C#
Article

Custom ListView class for Report Generation, Part 1

Rate me:
Please Sign up or sign in to vote.
2.95/5 (10 votes)
14 Mar 2005 70K   1.7K   24   2
A simple class generating printible reports.

Screenshot

Introduction

I've been using nashcontrol for generating reports, but had a difficult time incorporating the code into existing applications. In addition, his control does not provide the same functionality for list view controls. Nash’s control also had a drawback that it would crash for spaces in the column titles. This control is basically a wrapper for quick integration into existing code for printing listview controls.

Using the code

MyListView control is derived from System.Windows.Forms.ListView, so use it like the native ListView control. The only additional functionality is that for printing the ListView.

C#
// call the print method for displaying the Nash’s print dialog.
this.listView1.Print();

Screenshot

Points of Interest

In the report, the column width is determined by the width of the columns in the ListView. For a detailed overview of the printing process, refer to the referenced article.

History

This is the first version, as soon as I get some time, I'll complete the tutorial.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Founder Uraan Software Solutions
Germany Germany
We are a software development and consultancy firm based in Lahore, Pakistan.

Comments and Discussions

 
GeneralError in 'system.drawing.dll' Pin
capuccino_fr3-Apr-06 0:18
capuccino_fr3-Apr-06 0:18 
GeneralRecommended Changes Pin
sreejith ss nair27-Jun-05 23:46
sreejith ss nair27-Jun-05 23:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.