Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
How to Include <if> Statement after else statement?
Example:
<%beginLevel 1%>
<%if {Category} == "Heading"%>
<%{Text} richcontent=false%>
<%elseif {Category} == "Comment"%>
<%{Text}%>
<%else%>
==========================================
<%if{Notes}!=""%> How to include this block in export template)
<%{Notes}%>
<%endif%>
============================================
<%{Category}%> :: "><%{ID}%>
<%{Revision Date}%> :: <%{Priority}%>
<%endif%>
<%endLevel%>
-Shankar
As far as I know from my last experience dated back to MKS 2009SP7, it is not possible to use nested if conditions in the word export template. It would be great if it were supported.
I agree.
(there used to be a discussion thread about this in the old MKS community)
And since there was no reported change in the release notes up to I10.2 the following is still true:
The gateway does not support "nested IF clauses".
If you need it badly, you have to "workaround" and form the whole number of possible combinations as a set of "elseif" statements. Or you might find a way in using more complex XPATH statements.
@ Shankar : I'm interested in your solution, please post it here
Regards Matthias
Yes! I've written a script in Matlab to create intelligent Word Templates using Word ActiveX.
Main motivation was only display fields if they are specified.
(I don't want a Rationale or Stakeholder Comment section if nothing is written in it in my Word Export)
With such script it is also possible to define ExcludeFilters like: ExcludeFilter='({State} == "Cancelled") OR ({Text} == "<div></div>")';
(I've already requested to PTC the feature to be able to filter the items to export before running the export or run the export using the current documentview filter. This would be I think a great enhancement.)
.. (I've already requested to PTC the feature to be able
to filter the items to export before running the export or
run the export using the current documentview filter.
This would be I think a great enhancement...
I totally agree.
A behaviour similar to the Excel Export feature ("all items in current view" or "only current selection") would be fine.
Nevertheless I understand the that the drawback is the SECTION numbering (that is currently derived from the items position in the relationship tree of the entire document) - but to be honest I could live without the section
The Gateway User Guide has the information regarding how to set conditional formatting starting around page 84. You can find the guide at:
http://www.ptc.com/WCMS/files/143552/en/GatewayUserGuide_2009SP7.pdf