|
-
Dec 1st, 2005, 08:47 AM
#1
Thread Starter
Fanatic Member
-
Dec 1st, 2005, 08:55 AM
#2
Re: How to print data from vb
You can either use a report tool or use the Printer object directly. With the Printer object you get the most freedom but it also requires you to write all the code yourself.
VB Code:
Printer.Print "Hello"
Printer.NewPage
Printer.Print "Page 2"
Printer.EndDoc
The above is of course pretty useless by itself but it does show you how to print text and to create a new page and finally how to end the printing (which will let the spooler take over and actually do the printing). You set the position you want to print something with the CurrentX and CurrentY properties. The Printer object also allows you to draw simple graphics like lines and circles as well as to draw images.
-
Dec 1st, 2005, 09:29 AM
#3
Thread Starter
Fanatic Member
Re: How to print data from vb
can you give some sample code(s) on how to put some graphics? or other references to help my problems? Actualy I already used that code you've provided. But problem is how to print the next page? I put all datas on a grid before user can print (I add button where user click to print). Any help please. I think this is just a very simple for others.hehe... any can help me...tnx in advance.
-
Dec 1st, 2005, 09:44 AM
#4
Re: How to print data from vb
Well, using the NewPage method will create a new page and any printing done after that is made on the new page. You can use the PaintPicture method to draw graphics in the same manner as you would do with a PictureBox or the Form. Here is the full documentation of the Printer object.
-
Dec 1st, 2005, 09:56 AM
#5
Thread Starter
Fanatic Member
Re: How to print data from vb
thanks, but hope you can provide more ideas.
noister
<advertising link removed by moderator>
-
Dec 1st, 2005, 12:47 PM
#6
Re: How to print data from vb
Moved to Reporting section.
 Originally Posted by noielen
thanks, but hope you can provide more ideas.
The two ways to print are to use the printer object, which Joacim has covered, or, as he also suggested, use a reporting tool. There are no other ideas.
If you do not wish to use the printer object, then you would need to decide which of the several reporting tools available are best suited for your needs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|