**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

    • Post Options:
    • Link

    Posted 4 August 2017, 5:23 am EST

    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



    ************** 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”

        

    rpt.Printer.DeviceName = cPrinter

    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 ***************************************



  • Posted 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

  • Posted 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 *******************

    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 & "]"



    ******************* END CODE SNIPPET ***************



    ******************* LOG SNIPPET ***************

    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]



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

  • Posted 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

  • Posted 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/

  • Posted 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/

  • Posted 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.

  • Posted 19 December 2019, 8:16 pm EST

    When opening or printing a report you get a Gray Screen or:

    Error 5707 - Set device name failed. Invalid printer device name

    [url=http://mywifeixt.net/]mywifiext

    Cause:

    The last printer used by Active Reports is remembered and could have changed.

    Solution:

    1. Login to All Orders as Admin
    2. In All Orders do File - Maintain
    3. Click the ‘Advanced’ Tab
    4. Press the ‘Run DB Command’ button
    5. Cut and paste the following into the box

    UPDATE [dbo].[refReports]

    SET [ReportPrinter] = Null;


    1. Press the ‘Run’ button
    2. You will get a message ‘Command completed successfully’
    3. X out of the window
    4. Close file Maintenance window

    10.Go to COMPANY–>PREFERENCES–>REPORTS—> uncheck the setting to apply the default printers. http://mywifeixt.net/

    Should you get a message other than ‘Command completed successfully’ please report it to us.

Need extra support?

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

Learn More

Forum Channels