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

    Ask code set printer for the report ?

    Assuming the computer has installed 2 printer name: printer1, printer2 and in my program has 4 report name: ActiveReport1, ... ActiveReport4. Status to avoid crafted before viewing or printing in the printer before you have to choose, I can write code automatically select the printer before printing or print view, for example, when prints ActiveReport odd numbers will viewed or print on printer1 and ActiveReport even numbers when viewed in print or on printer2. for example code this.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Ask code set printer for the report ?

    Create ActiveReport1-Odd and ActiveReport1-Even reports
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

    Re: Ask code set printer for the report ?

    If you are using ActiveReports as would seem to be the case you Set the Printer property of the report to the printer you want to use.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Ask code set printer for the report ?

    Probably not EVEN and ODD pages (without a Macro)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

    Re: Ask code set printer for the report ?

    That is not what I got from his post. He said that he had four reports 1-4 and wanted the odd numbers on one printer and the even numbers on the other printer. To me this means Report 1 and 3 get sent to printer 1 and report 2 and 4 get sent to printer 4. Printing even pages to one printer and odd pages to another would be a very strange way to go and I doubt that any report engine would support that.

    It has been a while since I have done this with Active reports so I am not clear on the method at the moment but it either has a Printer property that you can set through code or it uses the VB printer object that is set at the time. In either case it is a simple matter to change it through code at run time.

    Not sure where you think a Macro would come in as they do not exit in VB or active reports.
    Always use [code][/code] tags when posting code.

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