Printer selection with word layout NAV 2015

Yogi1983Yogi1983 Member Posts: 22
edited 2015-03-25 in NAV Three Tier
Hi experts,

I've encountered a limitation in the word layout functionality in NAV 2015. It seems that it disregards the Printer Selection setup completely. Furthermore, there is no Print dialog so all Word layouts are always printed from the default Windows printer of the users work station. I've been looking around but I cannot find any solutions / workarounds to fix this. I've seen that through CU1 (function MergeDocument) some .NET functions are called, ending in a WordHelper.CallPrintOut statement but couldn't find anything that could influence the printer from there.

Now as the Word layout function is reasonably easy to understand and nice for small customers, this seems kind of strange because it is very basic functionality that basically every customer uses. Am I overlooking something obvious? Or is it technically just not possible and is the only way to select the printer is to use RDLC?

Any suggestions / solutions / workarounds are much appreciated, thanks in advance!

Kind regards,

Rogier

Comments

  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    You are absolutely right. This was a missing feature, but has now been released with the latest cumulative update in March 2015.
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • Yogi1983Yogi1983 Member Posts: 22
    Thanks Bardur for your answer. However, I still don't get it to work.

    I've first upgraded all the code changes to CU5 (build 40262). I tested it with still the same result, the report only prints from default Windows printer. After that I also upgraded service tier, database and client (technical upgrade) but still the same result. So my environment is now completely on Cumulative Update 5, both in code as technical and I still can't get it to work with Printer Selection.

    Am I missing something / do I need to set up something else? Thanks for your help.
  • geordiegeordie Member Posts: 655
    For 2015 CU4, if I'm not wrong, a unistall/reinstall of NAV was required to make the update really effective.
    Did you just replaced the files or perform a complete installation?
  • Yogi1983Yogi1983 Member Posts: 22
    Ok thanks, I replaced the files indeed. Is uninstall / install of client enough or is uninstalling the service tier also necessary?

    Thanks again.
  • geordiegeordie Member Posts: 655
    Yogi1983 wrote:
    Ok thanks, I replaced the files indeed. Is uninstall / install of client enough or is uninstalling the service tier also necessary?

    Thanks again.

    Yes, you have to reinstall the NST as well.

    Daniele
  • Yogi1983Yogi1983 Member Posts: 22
    Unfortunately after complete uninstall / reinstall of the NST and client and after the database conversion to CU5, it still does not work. NAV keeps printing from the default Windows printer.

    So, summarized the actions:
    1. Started from NAV 2015, Cumulative Update 1 (build 38457)
    2. Set up custom Word layouts for several reports, set up the correct report selections and set up printer selection to various printers
    3. Tested from various work stations, all work stations only print all reports to the default Windows printer, regardless the printer selection
    4. Upgraded the application code to Cumulative Update 5 (build 40262), with no other result
    5. Completely uninstalled NAV Cumulative Update 1 and reinstalled NAV Cumulative Update 5, with no other result.

    Noticed that in variable "Printername" in CU 9651 in function PrintWordDoc does contain the correct printername from the printerselection. However, from that function the function PrintWordDocInWord is called and from there the printername is lost.

    Anybody who got this feature working correctly? And any other suggestion is welcome too ofcourse..thanks again.
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    I have investigated the issue further, and I must admit in shame that I have misled you. There *was* indeed a fix that was intended to be included in CU5, but for various technical reasons we had to pull it out again and redo the way we deploy the add-in. In all likelihood the proper fix is included in CU6 which will be released in a week or so. My sincere apologies.
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • Yogi1983Yogi1983 Member Posts: 22
    Thanks for your answer, in the meantime I have found a solution myself (don't know if it's the proper technical solution but it works). I share it here in case someone else needs it:

    Applied to function PrintWordDocInWord in CU 9651 (you also need to pass variable PrinterName to this function). It basically sets the default printer to the printer from the printer selection and after that resets the default printer to the orginal value.
    WordApplication := WordApplication.ApplicationClass;
    //FIX
    DefaultPrinterName := WordApplication.ActivePrinter;
    WordApplication.ActivePrinter(PrinterName);
    //
    WordDocument := WordHelper.CallOpen(WordApplication,FileName,FALSE,FALSE);
    WordHelper.CallPrintOut(WordDocument);
    //FIX
    WordApplication.ActivePrinter(DefaultPrinterName);
    //
    
  • chrisdfchrisdf Member Posts: 82
    Hi,

    If Bardur is still monitoring this thread, could you please tell us if this fix is ever likely to appear? We are now NAV2016 CU10 and it still just prints to the Default printer.

    We have figured out how to launch the Windows Printer Selection dialogue through a modification to codeunit 9561 (not the one above which did not work for us) but sadly it effectively opens the Word application and the report "appears" with the dialogue box on top of it (s an effective preview). Also, this happens with the Word application flashing on the task bar and not just displaying the dialogue within the Navision application.

    I am wondering whether this is why Microsoft have never released a fix for this?

    Could you let us know please?

    Thanks!
  • mikhaelmikhael Member Posts: 19
    Seems that this is not working even in NAV 2017.

    Have you created any feasible workarounds to solve this issue?

Sign In or Register to comment.