Alpha Video Training
Results 1 to 5 of 5

Thread: default number of copies to print

  1. #1
    Member
    Real Name
    bobby dal
    Join Date
    Jan 2010
    Posts
    13

    Default default number of copies to print

    Hello,
    I am using Win7 and Alpha V v10. Using an application based on the old Alpha Sports app. When I am ready to print my invoice I want a default number of
    copies to be 2 ....I have my invoice form with a button that on push offers a print/preview box which I push the enter button on the keyboard. The next popup
    is the Windows 7 print box where I can change the printer, page range and Number of Copies. I want the number of copies to be 2, by default, but have the option
    to change it. I assume the Win 7 popup is being set by A5 before it displays. The print function then prints a report (which is my invoice) I get this working eventually but everytime I have changed a printer it quits working
    properly..goes back to a quanity of 1. I can't find where to set it If it helps I have copied the code for the button

    'Last Updated: 19-Jul-2012 11:48:31 AM
    'Created By : gold ring
    'Updated By : Bobby
    PARENT.commit()
    dim A_ASK_PRINT as c
    dim A_FORM_CURRENT as c
    dim A_ASK_INVOICE as c
    dim INVOICE_NUMBER as c
    range.flags=RANGE_INDEX.or.RANGE_FIRST.or.RANGE_LAST
    range.index_handle=index_record_get(db_current())
    range.filter=""
    range_add(db_current(),recno(),recno())
    A_ASK_PRINT=ui_get_radio(this.text,1, "Print","Preview")
    if A_ASK_PRINT="Print"
    goto print
    elseif A_ASK_PRINT= "Preview"
    goto preview
    else
    goto cleanup

    end if

    print:
    :Report.print("Invoice",db_filter_get(db_current()),db_order_get(db_current()))
    goto cleanup

    preview:
    :Report.preview("Invoice",db_filter_get(db_current()),db_order_get(db_current()))
    goto cleanup

    cleanup:
    range_drop(db_current())

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: default number of copies to print

    Hi Bobby,

    Have you tried the printer override settings? You will find it on the Options tab of the Print a Layout Genie.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Member
    Real Name
    bobby dal
    Join Date
    Jan 2010
    Posts
    13

    Default Re: default number of copies to print

    Hello Keith,
    Not sure where "Print a Layout Genie" is located. I appreciate the thought but I can't find it.

    Regards, Bobby

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: default number of copies to print

    Bobby,

    Create a button on a form and select Action Sripting to Print a report.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #5
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,875

    Default Re: default number of copies to print

    There is a much cleaner way to do what you want to do.

    your code:
    Code:
    'Last Updated: 19-Jul-2012 11:48:31 AM
    'Created By : gold ring
    'Updated By : Bobby
    PARENT.commit()
    dim A_ASK_PRINT as c
    dim A_FORM_CURRENT as c
    dim A_ASK_INVOICE as c
    dim INVOICE_NUMBER as c
    range.flags=RANGE_INDEX.or.RANGE_FIRST.or.RANGE_LAST
    range.index_handle=index_record_get(db_current())
    range.filter=""
    range_add(db_current(),recno(),recno())
    A_ASK_PRINT=ui_get_radio(this.text,1, "Print","Preview")
    if A_ASK_PRINT="Print"
    goto print
    elseif A_ASK_PRINT= "Preview"
    goto preview
    else
    goto cleanup
    
    end if
    
    print:
    :Report.print("Invoice",db_filter_get(db_current()),db_order_get(db_current()))
    goto cleanup
    
    preview:
    :Report.preview("Invoice",db_filter_get(db_current()),db_order_get(db_current()))
    goto cleanup
    
    cleanup:
    range_drop(db_current())
    Code I use to print a report from a form:

    Code:
    record_number = current_record_number()
    query.filter = "recno() = " + record_number
    query.order = ""
    if UI_GET_PRINT_OR_PREVIEW() = "PRINT"
         :Report.Print("Invoice",query.filter,query.order)
      else
         :Report.Preview("Invoice",query.filter,query.order)
    end if
    When you are designing the report, you can specify in the report properties the number of copies needed or you can do it in code and just loop through the ":Report.print" a number of times to satisfy your requirements.

    Tom
    Last edited by Tom Henkel; 12-21-2012 at 10:43 AM. Reason: missed a Quote

Similar Threads

  1. Print "copy number" on label when using "number of copies each label"
    By JEBCALMARK in forum Alpha Four Versions 7 and 8
    Replies: 5
    Last Post: 10-11-2009, 07:05 PM
  2. Print "copy number" on label when using "number of copies each label"
    By JEBCALMARK in forum Alpha Four Version 6 and Prior
    Replies: 0
    Last Post: 09-17-2009, 01:17 PM
  3. Print: number of copies sticks
    By Anthony Holland in forum Alpha Five Version 5
    Replies: 0
    Last Post: 02-13-2003, 11:43 AM
  4. Number of copies to print
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 6
    Last Post: 12-17-2001, 01:30 PM
  5. Print x number of copies
    By George BVI in forum Alpha Five Version 4
    Replies: 3
    Last Post: 05-14-2000, 05:06 AM

Bookmarks

Posting Permissions

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