**ERROR # 5707:Set DeviceName failed. Invalid printer device name. Device name doesn't exist or operation failed -

Posted by: scottvandenelzen-com on 4 August 2017, 5:23 am EST

  • Posted 4 August 2017, 5:23 am EST

    <font size="1"><font size="3">Hi-

    I'm having a problem with some code that has worked for a long long time.  It's happening on multiple computers.  I'm getting an the error above I'm trying to set the printer (the red line).

    The printer does indeed exist and works fine.  If I run the report to the viewer control and print, it prints fine. 

    Thanks for your help!

    Scott</font>

    ************** CODE SNIPPET ******************************************
    Set rpt = New ActiveReport
        
    LogMsg "RptServer", "RptServer", "RunReport", "RptServer.RunReport - LOADING RPX FILE FOR OUTPUT " & cRPXFile & " to printer " & cPrinter
        
    rpt.LoadLayout cRPXFile
    LogMsg "RptServer", "RptServer", "RunReport", "RptServer.RunReport - " & cRPXFile & " Loaded"
        
    <font style="BACKGROUND-COLOR: #ff0000"> rpt.Printer.DeviceName = cPrinter
    </font>LogMsg "RptServer", "RptServer", "RunReport", "RptServer.RunReport - Printer set to " & cPrinter
        
    'cancel the display of any message boxes with error messages if an error would occur
    rpt.ShowMessages = False
       
    ************** END CODE SNIPPET *************************************

    ************** LOG SNIPPET ******************************************
    10/12/2004 10:25:46 AM:RptServer.RunReport - RptServer.RunReport - LOADING RPX FILE FOR OUTPUT c:\inetpub\wwwroot\visonex\reports\flowsheet.rpx to printer Wang LCS15

    10/12/2004 10:25:47 AM:RptServer.RunReport - RptServer.RunReport - c:\inetpub\wwwroot\visonex\reports\flowsheet.rpx Loaded

    10/12/2004 10:25:48 AM:RptServer.RunReport - **ERROR # 5707:Set DeviceName failed. Invalid printer device name. Device name doesn't exist or operation failed -

    10/12/2004 10:25:48 AM:RptServer.Class_Terminate - END

    ************** END LOG SNIPPET ***************************************

    </font>
  • Replied 4 August 2017, 5:23 am EST

    Hi Peter

    Interestingly enough the ReportServer object doesn't "see" any of the installed printers anymore.

    If I enumerate through the VB Printers object I see the 3 printers installed on my test server.

    BUT - rpt.Printer.NDevices returns 0

    This used to work just fine - any ideas?

    Thanks,

    Scott

    ******************* CODE SNIPPET *******************
    <font size="1">Set rpt = New ActiveReport
    LogMsg "RptServer", "RptServer", "RunReport", "RptServer.RunReport - LOADING RPX FILE FOR OUTPUT " & cRPXFile & " to printer " & cPrinter
        
    rpt.LoadLayout cRPXFile
    LogMsg "RptServer", "RptServer", "RunReport", "RptServer.RunReport - " & cRPXFile & " Loaded"
        
    LogMsg "RptServer", "RptServer", "RunReport", "Looking through array of " + CStr(rpt.Printer.NDevices) + "devices to find printer [" & cPrinter & "]"

    <font size="3">******************* END CODE SNIPPET ***************</font>

    <font size="3">******************* LOG SNIPPET ***************</font>
    10/12/2004 4:05:24 PM:RptServer.RunReport - RptServer.RunReport - LOADING RPX FILE FOR OUTPUT c:\inetpub\wwwroot\visonex\reports\flowsheet.rpx to printer Wang LCS15

    10/12/2004 4:05:25 PM:RptServer.RunReport - RptServer.RunReport - c:\inetpub\wwwroot\visonex\reports\flowsheet.rpx Loaded

    10/12/2004 4:05:25 PM:RptServer.RunReport - Looking through array of 0devices to find printer [Wang LCS15]

    <font size="3">******************* END LOG SNIPPET ***********</font>

    </font>
  • Replied 4 August 2017, 5:23 am EST

    If you're getting this error, then the cPrinter string is not able to be found in the list of available installed printers.  To get a list of currently available printers, you can use the Devices property:
    http://www.datadynamics.com/Help/AR2/AR2Std/HX_Printer_Devices.html
  • Replied 4 August 2017, 5:23 am EST

    The process running the report server may not have permissions to the printer.  If this is an asp project, please see the following KB article:
    http://www.datadynamics.com/ShowPost.aspx?PostID=2275

  • Replied 28 September 2018, 5:35 pm EST

    I have a network printer. I connect my mac. But it is not print. I uninstalled driver again installed but again it does not work. then I searched for some additional information that commonly associated with newer models, this error code indicates a problem with the motorized tray lift. Check there are no obstructions such as staples or paperclips. get any information contact with Hp printer support number: https://www.printererrorrepair.com/hp-printer-support-phone-number/
  • Replied 28 September 2018, 9:49 pm EST

    You must have to ensure that your device is connected to the Internet for the wifi service I mostly prefer Linksys E3200 USB support router If anyone has a problem to set up this router take help from this site:https://www.linksysroutersupportnumber.com/
  • Replied 28 October 2018, 6:05 pm EST

    Follow this step to solve the paper jam issue, Turn on the printer. While still on, unplug the power cord from the printer. Remove any connected cables as well. Open printer lid to reveal cartridge carriage. The carriage should be at the right side of the printer. Remove paper jam or foreign objects. Manually move the cartridge carriage to the left side.

    you can solve your printer issue with this site

    https://www.hpsupporthelpline.com/blog/tag/printer-not-activated-error-code-20/
    it really provides the best solution.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels