Results 1 to 5 of 5

Thread: Using the Print object

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    Pune,India
    Posts
    37

    Using the Print object

    hi,
    Is there a way I can use the Print object in VB to generate a report , but with a preview option. i.e I display the report to the user in some format(other than the printer) and then he has the option to print it, without regenerating the report.
    I hope I made my question clear enough.
    Thanks
    Smoking Kills Slowly!!!!!!!!...........So who's in HURRY????????

  2. #2
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    Use VB reports or if you want more power and professional thing go in for Crystal Reports

    Kinjal

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You could simply switch out the Printer object for the PictureBox control....

    PictureBox and Printer Objects share many common properties except for .EndDoc and .NewPage.....

  4. #4
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    yak77,
    of course there is. Printer object is what yuo need. It's just some coding involved: page dimentions, fonts, lines (horisontal and evrtical, carret, new lines, tabs, current coordinates and some other things. If you don't mind all this then take your time and do it. As for a Preview window you may display everything on the blank form and then print to printer.

    Roy

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    As an example, I implemented a routine that can be passed either a Printer or a Picturebox object to create a chart... it looks exactly the same no matter which object is passed.
    VB Code:
    1. Public Sub FillChart(someobject As Object)
    2. Dim myobject As Object
    3.     Set myobject = someobject

    As I mentioned above, some properties of the Printer Object don't work with the Picturebox, and vice versa (but they are few).
    VB Code:
    1. If TypeOf myobject Is PictureBox Then
    2.         myobject.BackColor = vbWhite
    3. EndIf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width