Results 1 to 4 of 4

Thread: [RESOLVED] How to print a report without having to view it?

  1. #1

    Thread Starter
    New Member newbie123's Avatar
    Join Date
    Apr 2006
    Posts
    14

    Resolved [RESOLVED] How to print a report without having to view it?

    Good day,
    I'm trying to develop one of my own applications in VB6 and I wanted to print out a receipt(created from crystal report 8.5) automatically? I use this simple code just to view a sample report:

    Note: used the crystal report ocx for this one

    VB Code:
    1. With CrystalReport1
    VB Code:
    1. .DataFiles(0) = XXXXXXXXXXXX
    VB Code:
    1. .ReportFileName = XXXXXXXXX
    VB Code:
    1. .Action = 1
    VB Code:
    1. End With


    but I want to know how to print a report without having to view it. Can you help me please?
    newbie123

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to print a report without having to view it?

    Try this
    VB Code:
    1. With CrystalReport1
    2.       .DataFiles(0) = XXXXXXXXXXXX
    3.       .ReportFileName = XXXXXXXXX
    4.       .Destination = crptToPrinter '<<==== add this line
    5.       .Action = 1
    6. End With

  3. #3

    Thread Starter
    New Member newbie123's Avatar
    Join Date
    Apr 2006
    Posts
    14

    Re: How to print a report without having to view it?

    Problem Solved!
    newbie123

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] How to print a report without having to view it?

    Quote Originally Posted by newbie123 via PM
    What if the printer was relocated to another computer. would it still work? how can i make it print it in a network environment?
    Please post your questions on the open forum. If you have a question, chances are very good that someone else is going to have the same question at some point, and it a question is answered in a PM, that future member is not going to find an answer.

    When you use crptToPrinter Crystal will use whatever is currently setup on the machine as the default printer, regardless of where that printer is.

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