We have had a few instances where Dynamics GP Word Templates will not print out to the screen when running on a citrix environment.
I’m happy to say that I think we have figured out what is causing this specific issue.
The symptoms are that you have set up Dynamics GP Word Templates, but when logged into a citrix environment, when you attempt to print the template to the screen, it appears nothing happens. Word does not open. In this scenario, the templates will not print to the printer either.
The first thing that you want to do is make sure to troubleshoot the problem in GP so you make sure that you have everything set upcorrectly. You would want to check security so you know what report writer report is printing (modified, modifiedalternate, etc.), make sure you have a template set up for that report. Make sure the template is assigned to thecompany you are in and is set as default. In this scenario, remove any customer/vendor assignments on thetemplates. When the templates are assigned to customers/vendors, it complicates the scenario because there can bemultiple word templates being used and you want to eliminate that for baseline testing. You can add the customer/vendorassignments back after you have the templates working. Once you have verified these things, thetemplate should print.
In this scenario, the TPElogging helps because if you have logging turned on, you should be able tosee that the word doc is being created, but it’s just not opening in word. That would prove that the word doc is beingcreated correctly.
I don’t want to get too technical here but I do want to shed some light on what GP is doing to get the word template to print out to thescreen. This process is handled by the Microsoft.Dynamics.GP.BusinessIntelligence.TemplateProcessing.dllin your addins folder under GP. This dll handles most of the template processing. When it gets to sending the word document to the screen, the dll is using the Process.Start(ProcessStartInfo) method in theSystem.Diagnostics namespace. In this call, we are passing an “Open” verb in ProcessStartInfo. What this will do then is open whateverdocument we are passing in its associated program. In our case, it is a docx file which should be associated with Word. However, thisworks for any application. So if you called this same method with a pdf file, it should open the pdf in Adobe orwhatever is associated to a pdf file. So it’s a universal way to open a document.
Upon extensive investigation, what we found is that in some Citrix environments, Citrix has a Windows Shell Extension that is interceptingthese calls to Process.Start() with the “Open” or “Print” verb and it’s preventing the application from opening. In the two cases that we had this issue, the problem wasn’t specifically with Word, no application would open when called this way. We tested pdf’s and txt’s and those didn’t work either. In this case, the Citrix Shell Extension was CtxSFOShellExt.dll and it was located in the followingdirectory:
C:\Program Files\Citrix\Server Resource Management\MemoryOptimization Management\Program\CtxSFOShellExt.dll
It has something to do with Memory Optimization withCitrix. If you right click on a file, there was an additional option for Citrix Memory Optimization. When we chose that option, it would not letus open the document because it wasn’t optimized. I believe this Shell Extension has a handlerthat is catching the “Open” and “Print” verbs and checking if the document is optimized. If it isn’t, it doesn’t letthem open. A Citrix engineer may have more information on this particular Shell Extension.
I’m not recommending anything specific here other than contacting your Citrix engineer on how todisable this Shell Extension. However, there is a program available from Nirsoft that allows you to view and disableShell Extentsions that may able to help you. You would be doing that at your own risk because by disabling this, youcould cause other issues with Citrix. The best bet is to talk to Citrix about it. We did find however that disabling this ShellExtension did allow Word Templates to work on the Citrix Environment.