CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Posts
    19

    VB6 with Crystal Report 8.5 printing without view in default printer

    I am using Crystal Report 8.5 in VB6 to Print Invoice .. I am developing this application for my customer. I wish to print invoice without view the report and it should directly print to printer without view in crviewer.
    I don’t know which printer customer is using. So, Thru coding I wish to print report customer’s default printer.
    Here is my code. But no print out coming.
    If I choose crystal report 8.5 right click =>Designer=>Printer setup and then select printer I will work.
    No printer option is not displayed in printer setup dialog box.
    Please give me option to print default known printer

    my code:


    BILLPRINT.PrinterSetup defaultprinter
    BILLPRINT.PrintOut False

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB6 with Crystal Report 8.5 printing without view in default printer

    I do not use Crystal so can't say for sure but the default printer should be the default. There should be no need to call printersetup nor assign a printer at all.
    Have you tried it without that first line?

    I use Active Reports the print method is
    Code:
    ActiveReport1.PrintReport False
    The false tells it not to display the printer dialog and use the current default printer
    A setting of True tells it to display the printer dialog so the user can choose where to print.

    Also worth noting is that the default printer in this case may or may not be the system default printer.
    As far as the program is concerned the default printer is the one currently set in VB via the printer object which is by default the system default printer but can be changed via code using the Set Printer method of VB
    Last edited by DataMiser; September 19th, 2017 at 12:41 PM.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2008
    Posts
    19

    Re: VB6 with Crystal Report 8.5 printing without view in default printer

    Quote Originally Posted by DataMiser View Post
    I do not use Crystal so can't say for sure but the default printer should be the default. There should be no need to call printersetup nor assign a printer at all.
    Have you tried it without that first line?

    I use Active Reports the print method is
    Code:
    ActiveReport1.PrintReport False
    The false tells it not to display the printer dialog and use the current default printer
    A setting of True tells it to display the printer dialog so the user can choose where to print.

    Also worth noting is that the default printer in this case may or may not be the system default printer.
    As far as the program is concerned the default printer is the one currently set in VB via the printer object which is by default the system default printer but can be changed via code using the Set Printer method of VB
    i used
    BILLPRINT.PrintOut False

    but not printing system default printer

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB6 with Crystal Report 8.5 printing without view in default printer

    So is it printing on a different printer?
    Have you added any code into your project that changes the default printer for the project?

    What happens if you use True on that line instead of False?
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jan 2008
    Posts
    19

    Re: VB6 with Crystal Report 8.5 printing without view in default printer

    Quote Originally Posted by DataMiser View Post
    So is it printing on a different printer?
    Have you added any code into your project that changes the default printer for the project?

    What happens if you use True on that line instead of False?
    I used because i have to select one printer in Crystal report Designing time. I selected one of my printer. I don't know customers system default printer. The printing is fine in my system. But there is no printing in customer computer. His laser printer model is different. How can i overcome. I have forced to selected one printer in my crystal report designing time. PFA
    Attached Images Attached Images  

Tags for this Thread

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

Featured