473,408 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how print a listview

please i need to print a listview, c#
Nov 30 '09 #1
4 15947
tlhintoq
3,525 Expert 2GB
What have you tried so far?
Is your current code for printing producing an error or exception?
MSDN "how-to" for printing a document
Nov 30 '09 #2
Dheeraj Joshi
1,123 Expert 1GB
You mean, how to display the items in list view?

Regards
Dheeraj Joshi
Dec 1 '09 #3
no, i need print a listview in a printer. I have this code, but exist other opcion to print only text, not use a bitmap???
Expand|Select|Wrap|Line Numbers
  1.         Font printFont;        
  2.         Bitmap bitmap;
  3.         public void PrintAString(Bitmap data)
  4.         {
  5.             PrintDocument pd = new PrintDocument();
  6.             printFont = new Font("Arial", 12);            
  7.             pd.PrintPage += new PrintPageEventHandler(PrintPage);     
  8.             pd.DefaultPageSettings.Landscape = true;
  9.             pd.Print();
  10.         }
  11.  
  12.         private void PrintPage(object sender, PrintPageEventArgs e)
  13.         {            
  14.             bitmap = new Bitmap(this.listView2.Width, this.listView2.Height);
  15.             listView2.DrawToBitmap(bitmap, this.listView2.ClientRectangle);
  16.             e.Graphics.DrawImage(bitmap, new Point(70, 70));
  17.         }
  18.  
  19.         private void imprimirToolStripMenuItem_Click(object sender, EventArgs e)
  20.         {
  21.             PrintAString(bitmap);
  22.         }
Dec 1 '09 #4
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Dec 1 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: enahar | last post by:
how to print the listview items fron windows c# control Thanks Regards,
9
by: Devron Blatchford | last post by:
Hi there, Just wondering if I change the back and fore colour of a listview item when the mouse hovers over it? I want to overide the default windows colour. Can someone please tell me how to...
2
by: fre | last post by:
Hey, Is it possible to print out a table with the contents of my listview? thx ! Frederik
1
by: Little Man | last post by:
i have added some images in List View control how can i print these in a document??? thanks
2
by: Al Reid | last post by:
I'm using VB 2005. I have a production application where I load a ListView with information from several sources based on user interaction. At some point I need to iterate through the Items...
0
by: Lance | last post by:
Hi, Can someone provide an example or point me to a resource on how to print the Items and Sub-Items of a ListView Control? This is for a Windows app and I'm using VS2005. Everything I've...
1
by: Tark Siala | last post by:
Hi I have ListView contain data, and i want print this listview. i know i can do that by using Datareport and Crystal Report, but i need simple way to print this data. any ony have good idea? ...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
6
by: aaronv | last post by:
Hi vb programmers. I would just like to know if it's possible to directly print what I see on my listview or put what I see on my listview to a datareport. I am having a problem with printing...
0
by: tthomas52 | last post by:
I am trying to print the content of a listview with eight columns in it in vb.net 2003. So far everything I have tried has not worked. Below is the last code I tried using. It will print, however...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.