Alpha Video Training
Results 1 to 5 of 5

Thread: Report Printing Too Many Copies - As Many as Child Links

  1. #1
    Member
    Real Name
    Chris DiBianco
    Join Date
    Feb 2006
    Location
    Albany, NY
    Posts
    76

    Default Report Printing Too Many Copies - As Many as Child Links

    I have a simple set where I have customer data with a one to many link to their service invoices. When I print a report based on the customer information it prints multiple copies. We have figured out that it is printing as many copies as there are child links. For example if there are 4 invoices attached to that customer it is printing the report 4 times (actually 12 as we are telling it to print 3 copies to begin with).

    How do I correct this? Here is the xbasic script being used:

    Code:
    record_number = current_record_number()
    query.filter = "recno() = " + record_number
    query.order = ""
    
    
    
    'This script will override certain of the printer properties that are specified in the saved layout.
    delete options
    dim options as p
    
    'before you can initialize 'options' using the property_from_string() function at least one dot variable must exist. therefore, create a dummy variable.
    options.dummy = 1
    options_text = <<%str%
    <papersize="Letter">
    <copies=3>
    
    %str%
    'create a dot variable from options_text. the dot variable contains the printer properties to be overriden
    property_from_string(options,options_text)
    
    'now you can delete the dummy variable
    delete option.dummy
    
    'oldOptions will store the current printer options, so that we can restore them.
    delete oldOptions
    dim oldOptions as p
    oldOptions.dummy = 1 
    
    'set the printer override settings.
    
    if API_GETMACHINENAME() = "Spaservice"
    	old_printer_name = report.Printer_override(""+chr(92)+chr(92)+"POOLSERVICE\Service Order Printer on Ne00:",options,oldOptions)
    end if
    
    if API_GETMACHINENAME() = "Poolservice"
    	old_printer_name = report.Printer_override("Service Order Printer on Ne00:",options,oldOptions)
    end if
    
    
    'delete the dummy variable
    delete oldOptions.dummy
    
    
    :Report.Print("pool_cont1",query.filter,query.order)
    'Now restore the original printer settings 
    report.printer_override(old_printer_name,oldOptions)

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Report Printing Too Many Copies - As Many as Child Links

    There can be only one.

  3. #3
    Member
    Real Name
    Chris DiBianco
    Join Date
    Feb 2006
    Location
    Albany, NY
    Posts
    76

    Default Re: Report Printing Too Many Copies - As Many as Child Links

    I read the page and it seems like that is "Normal"?

    Is there a way to prevent it and print once instead of for every child?

    Excuse my ignorance as I am an end user that developed this solution over a long time. I am not a programmer but I am competent.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Report Printing Too Many Copies - As Many as Child Links

    Does your report only include fields from the parent table? If it does then the easiest solution is to copy the report to the parent table. Right click on the report name in the control panel, choose Copy To..., navigate to the parent table.
    There can be only one.

  5. #5
    Member
    Real Name
    Chris DiBianco
    Join Date
    Feb 2006
    Location
    Albany, NY
    Posts
    76

    Default Re: Report Printing Too Many Copies - As Many as Child Links

    Thanks Stan! That did the trick.

    Very simple solution when you understand the complete workings and dynamics of databases. I appreciate your help!!!!!


    Chris

Similar Threads

  1. Printing multiple label copies
    By mjfunnell in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 03-09-2015, 08:28 AM
  2. Keep printing 4 copies of the report
    By deputy956 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 10-20-2011, 08:49 AM
  3. printing multiple copies of a report
    By Ken Fleming in forum Alpha Five Version 4
    Replies: 2
    Last Post: 03-18-2004, 01:50 PM
  4. Printing many copies!
    By mark lclastr in forum Alpha Four Versions 7 and 8
    Replies: 0
    Last Post: 11-02-2003, 09:53 AM
  5. script for printing copies of.....
    By Josie Wendell in forum Alpha Four Version 6 and Prior
    Replies: 2
    Last Post: 01-17-2003, 08:07 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
  •