Somehow, these changes managed to crash and display a message in the Template Processing Exceptions(TPE) window and I ended up with this error:
One or more templates could not be processed. View the exception log for more details.
Well, that was a good start... but, where was the exception log?
Of course, being the well connected individual that I am - Ehem! - I sent this one off to my good friend Rob Wagner over at Microsoft Business Division, who is also known as "The Word Templates God" in some circles. Rob pointed me to a new DEX.INI setting available for Word Templates:
TPELogging=TRUE
In Rob's own words, "FYI, dex.ini TPELogging=TRUE is used to gather where an exception has occurred. It points the combine process where I will go in and debug the TPE.".
The log is created in the %temp% directory where the actual Word document is rendered and its content looks something like this:
10 hours. 57 minutes.13 seconds. 901 milliseconds. :20050: Combine.Unhandled
TPE was indicating that there was an issue with an exception not being handled when the XML data from Report Writer was being combined with the actual Word template.
This allowed Rob and his team to start tracking down the issue with my template from the source code and provide me with an alternate route to solve my problem.
As a final note, it seems there is an issue as well with TPE not clearing some process after choosing to remove the exception from the Report Processing Status window. In turn, this prevents shutting down GP via the Exit option, having to use the Windows Task Manager to force the termination of the DYNAMICS.EXE process. Rob's team is on this too.
Until next post!
MG.-
Mariano Gomez, MVP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/

6 comments:
Hi Mariano,
I probably missed this, but is there an alternate solution to the problem?
Leslie
What specific problem are you referring to? If by problem you mean the issue caused while attempting to exit Dynamics GP, then the answer is, I will have to follow up with Rob. I will keep you posted.
MG.-
Mariano Gomez, MVP
Hi Mariano,
So what was the alternsate solution to the problem with the Templates?
I am having the same error but works when logged in as sa.
The issue as I recall, has to do with attempting to make section changes to the Template, as opposed to making the changes in Report Writer. When you make changes to the template, it no longer matches the XML data file submitted by Report Writer to be consumed by the template processing code. That will cause the runtime engine to get confused and crash GP.
Alternate solution - more like, the right way - is to ensure the changes you need are performed via Report Writer.
NOTE: I have also found that if you make section changes (add/remove sections, for example) to the Report Writer report, you will need to match those changes in the template or this will cause GP to crash. Alternatively, you can use Word Template Generator to create a new template definition for the modified report, but as you can guess, this would mean making the template look nice again.
I hope this is what you are looking for.
MG.-
Mariano Gomez, MVP
Does it mean that if there are fields in Repoer Writer that I do not want to appear in the Word Template, I will have to remove the fields from Report Writer as well?
Thanks,
Philippe.
Phillipe,
In this case, all you need to do is remove the fields from the Template. No need to remove from Report Writer.
MG.-
Post a Comment