|
-
Mar 16th, 2005, 02:21 AM
#1
Thread Starter
Banned
how do print in vb 6.0
Hi
Need to print in vb 6.0
-
Mar 16th, 2005, 02:28 AM
#2
Frenzied Member
Re: how do print in vb 6.0
You need to look at the 'printer' object for methods and properties
printer.enddoc has to be called after you have done all your 'printing' to actually send everything to the printer.
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
-
Mar 16th, 2005, 03:26 AM
#3
Hyperactive Member
Re: how do print in vb 6.0
ei one thing, do you want to print the form or you want to print records from database?
-
Mar 16th, 2005, 04:25 AM
#4
Lively Member
Re: how do print in vb 6.0
do you want print simple form with text only? or form with lines and circles or graphics?
can any one help which is the best way to print in above cases?
-
Mar 16th, 2005, 04:51 AM
#5
Re: how do print in vb 6.0
VB Code:
Printer.print "This is a test"
Printer.EndDoc
Thats all there is to it!
-
Mar 16th, 2005, 04:57 AM
#6
Fanatic Member
Re: how do print in vb 6.0
PRINTER.PRINT
print "bob"
print "cox"
print "ok"
print
print "dos"
print "god"
PRINTER.ENDDOC
Last edited by bob5731; Mar 16th, 2005 at 05:01 AM.
P.S. God Love You And Have A Good Day!!! My web page
I need to get a free Iphone
-
Mar 16th, 2005, 05:32 AM
#7
Hyperactive Member
Re: how do print in vb 6.0
For some wierd reason, even if i use
It still wont print the text until my program ends :s
-
Mar 16th, 2005, 05:37 AM
#8
Re: how do print in vb 6.0
That is odd. As soon as I send EndDoc, the queue starts filling up.
How about in the IDE? Does it print immediately?
-
Mar 16th, 2005, 06:57 AM
#9
Re: how do print in vb 6.0
 Originally Posted by boku
For some wierd reason, even if i use
It still wont print the text until my program ends :s
Change your code to this and tell us what happens.
VB Code:
MsgBox "About to ENDDOC"
Printer.EndDoc
MsgBox "Just did the ENDDOC"
-
Mar 16th, 2005, 07:05 AM
#10
Re: how do print in vb 6.0
 Originally Posted by dos5731
Hi
Need to print in vb 6.0
You can get stuff out using what others have posted, but if you are looking for formal, stylized reports, you would need to incorporate a report engine into your project. The best 'free' type of report generator would be creating your reports in Access and calling them from your VB code. If you are working with a budget, then look into something like Report Writer or Crystal Reports.
-
Mar 16th, 2005, 07:46 AM
#11
Frenzied Member
Re: how do print in vb 6.0
Or On a budget of zero pounds. Invest some time with this little baby....
http://www.qbdsoftware.co.uk/moth/qp...qprinter20.htm
Not too shabby.
-
Mar 16th, 2005, 07:53 AM
#12
Junior Member
Re: how do print in vb 6.0
don't forget
printer.currentx
printer.currenty
printer.print ""
printer.enddoc
-
Mar 16th, 2005, 08:13 AM
#13
Re: how do print in vb 6.0
 Originally Posted by David.Poundall
I'd never heard of the "DonationWare" qPrinter product. This looks interesting...thanks for the link.
Last edited by Hack; Mar 16th, 2005 at 08:45 AM.
-
Mar 16th, 2005, 08:39 AM
#14
Frenzied Member
Re: how do print in vb 6.0
I used the earlier version on a commercial app and it was superb for doing reports. It comes with a handy print preview function a sstandard.
Edward Moth has rewritten the program from the ground up and now it enjoys easier table creation. I have yet to use this new version but I am looking forward to it as the template function looks a lote easier than before. The documantation is also very well put together.
-
Mar 16th, 2005, 08:43 AM
#15
Frenzied Member
Re: how do print in vb 6.0
Another print dll I have come across in the past, and tested, is this one.
CSPrintengine
I briefly considered it but decided at the end of the day to go with the one I knew more about. It looks a lot easier to use than qPrinter and the full version only costs $5.
Last edited by David.Poundall; Mar 16th, 2005 at 09:57 AM.
-
Mar 16th, 2005, 08:46 AM
#16
Re: how do print in vb 6.0
 Originally Posted by David.Poundall
Another print dll I have come across in the past, and tested, is this one.
CSPrintengine
I briefly considered it but decided at the end of the day to go with the one I knew more about. It looks a lot easier to use than qPrinter and the full version only costs $5.
When I tried this link, I got a "Page Could Not Be Displayed"
-
Mar 16th, 2005, 09:13 AM
#17
Fanatic Member
Re: how do print in vb 6.0
When I tried this link, I got a "Page Could Not Be Displayed"
http://www.consiliumsoft.com/
-
Mar 16th, 2005, 09:23 AM
#18
Re: how do print in vb 6.0
We found Crystal to be too cumbersome and too limited in ability.
We choose to develop our own report writer engine - it's actually a very simple task. We store "print objects" in a SQL table and loop through our data recordset and loop through the "print objects" and user .CURRENTX and .CURRENTY to produce extremely high quality reports.
Whenever a new twist comes down the pike, we simply enhance our report writer engine - it's extremely simple.
Last twist was to print the PO # on a purchase order vertically down the right side.
-
Mar 16th, 2005, 10:00 AM
#19
Frenzied Member
Re: how do print in vb 6.0
Sorry Guys I fixed the link - as I had saved it to hard disk it was referencing my E-Drive. It's OK now - here it the correct link as I am here.
http://www.topshareware.com/CSPrinti...load-11486.htm
Hi szlamany. Do you use a rich text box or a PictureBox for your reports. In either case how do you handle page breaks and word wrap?
-
Mar 16th, 2005, 10:18 AM
#20
Re: how do print in vb 6.0
 Originally Posted by David.Poundall
Hi szlamany. Do you use a rich text box or a PictureBox for your reports. In either case how do you handle page breaks and word wrap?
We output directly to the PRINTER object.
We have options to output also to a PICTURE BOX - but for the most part we ignore print-preview and have our users install FULL ADOBE, so they get the PDF print driver.
We make extensive use of .TEXTWIDTH to measure items - so we can "right-fill" our numeric values - so decimal places line up.
We always print with ";" at the end of the line, so we are fully in control of the vertical movement down a page.
It's so nice to be able to do things like: Print the ADDRESS on the bottom of the check first, then go back up to the top to output the stub info; Print multi-column reports; Print quandrant type output (student transcripts); handle all the extremely odd total/break conditions that financial systems can throw at you.
Here's a list of the "print objects" we support - plus there are lots of variations on these as well.
Code:
' 1 Font
' 2 Fontsize
' 3 FontBold=True
' 4 FontBold=False
' 5 FontItalic=True
' 6 FontItalic=False
' 7 Forecolor
' 10 Portrait
' 11 Landscape
' 12 Duplex (horizontal)
' 13 Paperpin
' 14 Papersize
' 20 Skip to line
' 21 Skip to next line
' 22 Header Control
' 23 Skip to right
' 24 Eject page
' 25 Break column
' 26 Specific column
' 27 Skip back to prior line
' 30 Date
' 31 Draw line
' 32 Draw left/right edge lines
' 33 Page
' 34 Query line
' 35 JPG
' 40 Item with CR
' 41 Item without CR
' 50 Column with CR
' 51 Column without CR
' 52 Column (first-name-first) with CR
' 53 Column (if-not-blank) with CR
' 54 Column (numeric) with CR
' 55 Column (numeric) without CR
' 56 Column (numeric-nz) with CR
' 57 Column (numeric-nz) without CR
' 58 Total with CR
' 60 Paragraph
' 61 Paragraph (next 255 characters of text)
' 62 Load Key Column Data
' 63 Dump Key Column Data
' 64 Clear Key Column Data
' 70 If
' 71 End if
' 72 If-Break Area
' 73 End if-Break Area
' 74 Sub-Heading
' 75 End Sub-Heading
' 80 Sub report
' 81 End Sub report
' 82 Sub report RS loop start
' 83 Sub report RS loop end
' 100 Output column to text file
-
Mar 16th, 2005, 10:36 AM
#21
Frenzied Member
Re: how do print in vb 6.0
There is a lot if IP there - nice. Thanks for the pointer. If I have time I may give that a go.
-
Mar 16th, 2005, 01:12 PM
#22
Re: how do print in vb 6.0
 Originally Posted by szlamany
We found Crystal to be too cumbersome and too limited in ability.
We choose to develop our own report writer engine - it's actually a very simple task. We store "print objects" in a SQL table and loop through our data recordset and loop through the "print objects" and user .CURRENTX and .CURRENTY to produce extremely high quality reports.
Whenever a new twist comes down the pike, we simply enhance our report writer engine - it's extremely simple.
Last twist was to print the PO # on a purchase order vertically down the right side.
I saw the post where you list some of the printer objects you store, and how you use them. Is what you are doing properity to your company?
I ask because if it is not, I think it would be very cool if you put together a little demo of how your 'print engine' works, and placed it in the Code Bank or Utility section. If you wouldn't be violating any copywrites, I think an example of this would be extremely beneficial to folks that don't have access to a report generator, and who don't have the existing skill set to create their own.
Just a thought...
-
Mar 16th, 2005, 01:29 PM
#23
Re: how do print in vb 6.0
Unfortunately it is proprietary - so I cannot put it on the code bank.
I have no problem sharing my concepts with those that ask.
Maybe in a year or so we will be marketing it outside the realm of our own applications.
-
Mar 16th, 2005, 09:42 PM
#24
Fanatic Member
Re: how do print in vb 6.0
it would be very cool ......., and placed it in the Code Bank or Utility section........, I think an example of this would be extremely beneficial to folks that don't have access to a report generator, and who don't have the existing skill set to create their own.
We could do the Classic VB programmers a big favor, if we did something along the lines of what you suggested.
It may very end up not being a single solution, but rather a set of a few solutions. If we find free (or dirt cheap) solutions along the lines of David's suggestions, then they may be part of our set.
If anyone is interested in furthering this, I think the first task is 'to clearly identify the problem' (the needs).
Can I start the ball rolling -
Some of the solutions may be code, and some be controls(if we can't get the source)
Any solutions must be free or extremely cheap.
They must not be complicated to install/distribute.
They must be reasonable easy to use ( or prior users be prepared to share the results of their learning curve)
etc
To illustrate why I think more than one solution may be required, we should cater for -
Print preview, as I don't wish to re-visit the days of printing off 10's of pages whilst trying to get the layout just right.
Normal reports (which can run to many pages).
Portrait and Landscape.
Embedded graphics.
Print Grid(s)
Print Form would be nice. This may be either a means to print the image on the screen, or something like what I use, which 'reads' the Form, and 'scrapes' the text, and box outlines etc. ('Hi Res' from Rod Stephens 'Graphics Programming' book).
I'm happy to let it throw to the default printer, but some of you may wish more control ?
Wouldn't it be ironic, that whilst 'Kill Bill' is trying to bury VB6, we provided the 'Holy Grail' that VB'ers have been searching for, for years.
Last edited by RobCrombie; Mar 29th, 2005 at 09:10 PM.
Rob C
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
|