VB.NET print question

Report printing in VB.NET

Page 1 of 1

3 Replies - 25832 Views - Last Post: 12 July 2006 - 06:45 AM Rate Topic: -----

#1 Ntinsky  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-July 06

VB.NET print question

Posted 08 July 2006 - 01:00 PM

Hi everyone

I am working with VB.NET and i managed to create a phonebook program.

I use a form to add,search and update records that i store in a txt file

My question is:

Is it possible to create a print report so i can print some of the records that i store in my phonebook program?

I don't want to use a database.Instead i use a list box and i can multiselect as many records as i want.My problem is that i cannot associate the records displayed in my listbox

For exaple i have now 5 records in my txt file and i can select them from my list box

How can i set my print report to display the data i get from my listbox?????

I tried to link some textboxes from my initial form but i cannot set my form1 or my txt file as a data source.



Thanks in advance.Sorry for those many questions i ask :P

Is This A Good Question/Topic? 0
  • +

#5 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: VB.NET print question

Posted 08 July 2006 - 01:51 PM

Absolutely you can create any kind of print report you want in vb.net. You will basically use the PrintDocument object on your toolbar. And then use DrawString methods to print from a listbox, textboxes, external files or whatever else you may need to print.

Here is a link to a tutorial that will get you started.

http://www.startvbdo...rintdialog.aspx

Quote

How can i set my print report to display the data i get from my listbox?????


A listbox has a SelectedIndex and SelectedItem methods by which you can retreive the data from it to print in your report.

Here is a tutorial explaining the methods:

http://www.startvbdo...ls/listbox.aspx

This post has been edited by jayman9: 08 July 2006 - 01:54 PM

Was This Post Helpful? 1

#6 Ntinsky  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-July 06

Re: VB.NET print question

Posted 09 July 2006 - 03:37 AM

Thanks jayman9.I ll give it a try my friend
Was This Post Helpful? 0
  • +
  • -

#7 Ntinsky  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-July 06

Re: VB.NET print question

Posted 12 July 2006 - 06:45 AM

View Postjayman9, on 8 Jul, 2006 - 12:43 PM, said:

Absolutely you can create any kind of print report you want in vb.net. You will basically use the PrintDocument object on your toolbar. And then use DrawString methods to print from a listbox, textboxes, external files or whatever else you may need to print.

Here is a link to a tutorial that will get you started.

http://www.startvbdo...rintdialog.aspx

Quote

How can i set my print report to display the data i get from my listbox?????


A listbox has a SelectedIndex and SelectedItem methods by which you can retreive the data from it to print in your report.

Here is a tutorial explaining the methods:

http://www.startvbdo...ls/listbox.aspx


Ok my printout is done.Now the only problem left is to see how to print the remaining records that don't fit on a paper A4 in a second page

I managed to fit 6 records per page

Is there a way for the print preview control to print the remaining records that do not fit on a second new page????

This post has been edited by Ntinsky: 12 July 2006 - 06:46 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1