How to address a printer's paper tray from Navision

alsolalsol Member Posts: 243
edited 2006-02-28 in Navision Attain
Hello
We have some problems with Navision and printers. Acutally we have to add a printer twice, one time per paper tray we want to print in. This is very hard work with many printers and sometimes 2 or 3 paper trays. Are there any other possibilities to address a paper tray directly out of Navision? Are there any tools to do that?

Regards
cyberscout

Comments

  • medostmedost Member Posts: 10
    First of all you need the correct sand the same version system driver on all of your PCs.

    Then get the software "FindTrays" in order to get the correct ID of the tray. Then enter this information in the Report Properties "PageSourceFirstPage" or "PageSourceOtherPages"

    There was also a bug in Navision. The Properties "PageSourceFirstPage" or "PageeSourceOtherPages were ignored when the Report was started with "UseRequestForm" = False. HF 30 for 3.60 and HF 12 for 3.70 fixes that poblem.

    Hope I could help you. Search the forum for other solutions.

    medost
  • g_dreyerg_dreyer Member Posts: 123
    medost wrote:
    Then get the software "FindTrays" in order to get the correct ID of the tray.
    medost

    Hi Medost,

    Do you know where to get "FindTrays", I have done a search on google, but it came up empty :cry: .

    Thanks,
    Gustav
  • LeoLeo Member Posts: 1
    Well, the thread is older, but the main question is still not answered:

    Where to find FindTrays?
    Leo S. E. Lang
    Freudenberg Schwab GmbH
    16761 Hennigsdorf
    Germany
  • LorryLorry Member Posts: 2
    Hi
    Better late than never!

    This problem cost me hours, so I hope this will help some people who are having the same:

    I also haven't found an application called "FindTrays", but I found an VB-script wich gives you the binary number of all trays back.

    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q194789&

    Create an Visual Studio 6 Form Project, place a Button and a Textbox with Multiline on. After that place that code:
    Option Explicit
    
    Private Declare Function DeviceCapabilities Lib "winspool.drv" _
       Alias "DeviceCapabilitiesA" (ByVal lpDeviceName As String, _
       ByVal lpPort As String, ByVal iIndex As Long, lpOutput As Any, _
       ByVal dev As Long) As Long
    
    Private Const DC_BINS = 6
    Private Const DC_BINNAMES = 12
    
    Private Sub Command1_Click()
       Dim prn As Printer
       Dim dwbins As Long
       Dim ct As Long
       Dim nameslist As String
       Dim nextString As String
       Dim numBin() As Integer
    
       Text1.Font.Name = "Courier New"
       Text1.Font.Size = 12
       Text1.Text = ""
       For Each prn In Printers
            dwbins = DeviceCapabilities(prn.DeviceName, prn.Port, _
              DC_BINS, ByVal vbNullString, 0)
            ReDim numBin(1 To dwbins)
            nameslist = String(24 * dwbins, 0)
            dwbins = DeviceCapabilities(prn.DeviceName, prn.Port, _
              DC_BINS, numBin(1), 0)
            dwbins = DeviceCapabilities(prn.DeviceName, prn.Port, _
              DC_BINNAMES, ByVal nameslist, 0)
            If Text1.Text <> "" Then
               Text1.Text = Text1.Text & vbCrLf & vbCrLf
            End If
            Text1.Text = Text1.Text & prn.DeviceName
            For ct = 1 To dwbins
               nextString = Mid(nameslist, 24 * (ct - 1) + 1, 24)
               nextString = Left(nextString, InStr(1, nextString, _
                 Chr(0)) - 1)
               nextString = String(6 - Len(CStr(numBin(ct))), " ") & _
               numBin(ct) & "  " & nextString
               Text1.Text = Text1.Text & vbCrLf & nextString
            Next ct
       Next prn
    End Sub
    
    Private Sub Form_Load()
       ' Size and position the Form and controls
       Me.Height = 7000
       Me.Width = 7000
       Text1.Top = 100
       Text1.Left = 100
       Text1.Height = 6450
       Text1.Width = 5000
       Text1.Text = ""   ' Clear the TextBox
       Command1.Left = 5300
       Command1.Top = 1000
       Command1.Width = 1500
       Command1.Caption = "List Bins"
    End Sub
    
    After clicking on "List Bins" you'll see a list of all your installed printers with their trays and bin-numbers.

    Example:
    \\server\HP4000PCL
    15 Automatically Select
    262 Auto Select
    261 Tray 1
    260 Tray 2
    259 Tray 3
    258 Tray 4
    257 Manual Feed (Tray 1)
    5 Envelope Feeder


    Place this code at the beginning of your report:
    CurrReport.PAPERSOURCE := PaperSource;
    

    PaperSource is an Integer wich is in the request form.
    For Tray 2 in this case, just enter 260 as PaperSource.

    If you want to give the customers the ability to do that, you could write an COM-Api and generate an own Listbox with the right trays!
    But that's another story :)

    Have Fun!
    Greetings
    Lorry
  • roynesroynes Member Posts: 23
    I have findtrays.exe,
    How can i post an attachment to this forum?

    Best Regards
    roynes@askerdata.no
  • KowaKowa Member Posts: 923
    Or you can try out this one :
    http://www.oraxcel.com/projects/printertrays/
    Kai Kowalewski
  • Timo_LässerTimo_Lässer Member Posts: 481
    Kowa wrote:
    Is that another one than we know?
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • KowaKowa Member Posts: 923
    Kowa wrote:
    Is that another one than we know?
    I haven't used FindTrays, PrinterTrays is the only one I know.
    Kai Kowalewski
  • Timo_LässerTimo_Lässer Member Posts: 481
    Kowa wrote:
    [...]
    I haven't used FindTrays, PrinterTrays is the only one I know.
    I mean this one: FindTrays.
    (I didn't know the source where I've got it. It's to long ago.)
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
Sign In or Register to comment.