|
-
Jul 11th, 2000, 12:32 AM
#1
Thread Starter
Fanatic Member
Dear All,
I've got a simple question for all of you. About print to printer. Hopefully, someone can answer my questions.
I have data in my database. I'd like to print them out to my printer directly without using any programs like using Crystal Report.
(Just like print to file (txt file), but this one, I'd like to print to printer).
Could anybody tell me how ???
Thx a lot,
Regards,
Wen Lie
-
Jul 11th, 2000, 12:45 AM
#2
Frenzied Member
No Problem, The Printer acts almost just like a Picturebox, First you have to Start a New Document. Then just use the Printer.CurrentX and Printer.CurrentY Properties to position the Cursor on the Printer and use
Code:
Printer.Print strMyString
to put some text on it, this puts it all on one line though, you need to Split it up to fit it on the page. If you Need to start a new Page use then use to print it.
-
Jul 11th, 2000, 01:11 AM
#3
Thread Starter
Fanatic Member
Thx...
Dear Sam,
About your answer,
should I add any Components or References to the codes ???
Thx,
Regards,
Wen Lie
-
Jul 11th, 2000, 01:22 AM
#4
Frenzied Member
Nope, why doesn't it work?
-
Jul 11th, 2000, 01:32 AM
#5
Thread Starter
Fanatic Member
Didn't print at all
Well,
Your code doesn't work at my station. Don't you think that I should add a components (ocx or dll) or maybe a reference ???
Or could you give me more code example in printing ???
Thx a lot,
Regards,
Wen Lie
-
Jul 11th, 2000, 01:39 AM
#6
Frenzied Member
OK, My Bad, I don't think you need the Printer.StartDoc
try this
Code:
Printer.Print "Hello"
Printer.EndDoc
My Printer's Broken So I can't test it.
-
Jul 11th, 2000, 08:42 AM
#7
It's also a good idea to set the coordinates of where you want to print. Otherwise, it will print to the Top-Left corner.
Code:
Printer.CurrentX = 1440
Printer.CurrentY = 1440
Printer.Print "Hello"
Printer.EndDoc
This will create a 1"x1" margin (1440 Twips per Inch). (If you set the ScaleMode to Inches, then you can change 1440 to 1)
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
|