Alpha Video Training
Results 1 to 6 of 6

Thread: Specify Printer- Same label differt PCs and printers

  1. #1
    Member
    Real Name
    Reyes Hernandez ii
    Join Date
    Aug 2009
    Posts
    29

    Default Specify Printer- Same label differt PCs and printers

    Hello:

    I have labels and reports that need to use a specific printer. The issue is that each computer has a different printer model and port number. The application works great on one computer but is unable to print, on other computers, because the printer name and port number are different then the one specified on the report or label.

    I am thinking that the best way is to name all the local printers the same and to insure that all the USB Label printer are on the same Port number.

  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,598

    Default Re: Specify Printer- Same label differt PCs and printers

    You can have the same printer listed with more than one name in the PC control panel/printers & faxes, so naming different printers the same should work. That way if you need different settings for each printer to work in Alpha you can configure the different drivers and yet everybody will be using the 'same' printer. Let us know how that turns out.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  3. #3
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,564

    Default Re: Specify Printer- Same label differt PCs and printers

    I wrote the following script that allows the choosing of a specific printer for a report and a specific printer for labels. When needed, this is used to override the default printer.
    These setting are written to the computer's registry so the settings are for that one computer only. This does not corupt the settings on other computers.

    In the autoexec script, you will need to add these lines:
    Code:
    dim global vcReport_Printer as C
    dim global vcLabel_Printer as C
    
    dim retrieve_settings as P
    a5_load_settings("Printer", retrieve_settings)
    vcLabel_Printer = retrieve_settings.Label
    vcReport_Printer = retrieve_settings.Report

    This is the script that is run to pick a specific printer for reports and a specific printer for labels and stores those choices in the registry.
    Code:
    'Date Created: 11-Aug-2012 09:19:59 AM
    'Last Updated: 11-Aug-2012 09:28:04 AM
    'Created By  : Ron
    'Updated By  : Ron
    '
    'ui_msg_box("Report Printer",vcReport_Printer)
    'ui_msg_box("Label Printer",vcLabel_Printer)
    
    'Create an XDialog dialog box to prompt for parameters.
    DIM SHARED vcList as C = vcLabel_Printer
    DIM SHARED vcList2 as C = vcReport_Printer
    DIM SHARED varC_result as C
    auto_list_vcList = ui_printers_get()
    auto_list_vcList2 = ui_printers_get()
    
    temp_count = w_count(auto_list_vcList,crlf())
    DELETE a_vcList
    DIM a_vcList[temp_count] as c
    a_vcList.initialize(auto_list_vcList)
    
    temp_count = w_count(auto_list_vcList2,crlf())
    DELETE a_vcList2
    DIM a_vcList2[temp_count] as c
    a_vcList2.initialize(auto_list_vcList2)
    
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box("Select Application Printers",<<%dlg%
    {xmargin=2,2}
    {font=arial,10}
    {ysize=.3};
    {region}
    {font=arial,10,b}
    Select the Label Printer:;;
    {font=arial,10}
     [%d%.80,10vcList^#a_vcList];
    {endregion};
    
    {region}
    {font=arial,10,b}
    Select the Report Printer:;;
    {font=arial,10}
     [%d%.80,10vcList2^#a_vcList2];
    {endregion};;
    {region}
    <15,1.5=ok_button_label!OK> <*15,1.5=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    
    if varC_result <> "OK" then
    	end
    end if
    
    vcReport_Printer = vcList2
    vcLabel_Printer = vcList
    
    'ui_msg_box("Report Printer",vcReport_Printer)
    'ui_msg_box("Label Printer",vcLabel_Printer)
    
    dim Printersettings as P
    dim Printersettings.Report as C
    dim Printersettings.Label as C
    
    Printersettings.Label = vcList
    Printersettings.Report = vcList2
    
    a5_save_settings("Printer", printersettings)
    Last, in the code you use to print, in this case we are printing labels, you need to add the line:
    Code:
    :report.Printer_override(vcLabel_Printer)
    :Label.Print("MyLabel",query.filter,query.order)
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,168

    Default Re: Specify Printer- Same label differt PCs and printers

    I was hopeful this would answer my question of how to determine what the current default printer is, but no joy. Ron, I get an error with your script. How is it this works for you?
    Attached Images Attached Images
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

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

    Default Re: Specify Printer- Same label differt PCs and printers

    I imagine you need to create those settings with the provided script for them to be able to be read later.
    There can be only one.

  6. #6
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,564

    Default Re: Specify Printer- Same label differt PCs and printers

    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

Similar Threads

  1. Label Printer?
    By Peter.Greulich in forum Alpha Five Version 11 - Desktop Applications
    Replies: 5
    Last Post: 11-19-2012, 12:47 PM
  2. default printer not matching listed printers
    By Lance Gurd in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 06-01-2008, 05:18 AM
  3. label printers
    By martinwcole in forum Alpha Five Version 4
    Replies: 5
    Last Post: 09-02-2000, 05:14 AM
  4. Label Printers
    By Nancy Eisenberg in forum Alpha Four Version 6 and Prior
    Replies: 5
    Last Post: 07-12-2000, 05:05 PM
  5. Dymo-CoStar Label Printers
    By Gary Smith in forum Alpha Five Version 4
    Replies: 2
    Last Post: 06-06-2000, 06:34 PM

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
  •