Word Templates will not print to screen

Dave Dusek - Click for blog homepageA common scenario that has been happening more and more is that a customer is trying to print out a word template just to the screen and the template won't print.  You will get a window called "Report Processing Status" and the report will be there and it will list a status of "In Progress" and it just won't ever print.  Another symptom of this issue is if you go to the Report Template Maintenance window and select a template and click Modify.  You will get an error "File not found" and it will give the path to the template. 

The main issue is that we are having trouble retrieving the template out of the syReportTemplates table.  The code that retrieves the template is in the Addin Microsoft.Dynamics.GP.ManagedStorage.dll.  In this dll, we use GPConnNet to make a connection to the database and retrieve the template.  When we call GPConnNet, we are passing the server name for the DSN parameter.  While this works in most cases, if you are on a SQL Cluster or using an IP address in your GP DSN, the code will fail and you will receive the above results.  This has been identified as a bug and is fixed in GP 2010 R2. 

The workaround is as follows.  Basically, all you have to do is set up a DSN identical to the GP DSN with the name of the SQLServer.  Here are the steps. 

  1. Log into the SQL Server and run this statement:  select @@servername
     
  2. Take the value that is returned and then create a new datasource with that name. 
     
  3. Set the datasource up identical to the datasource that they use to log into GP.  The only difference is the name.  Everything else is the same.  Test the connection. 
     
  4. Then try run your template again.  It should work at this point. 

Dave