cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to Include <if> Statement after else statement? in export template

ptc-4672719
1-Newbie

How to Include <if> Statement after else statement? in export template

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

5 REPLIES 5
tdalon
4-Participant
(To:ptc-4672719)

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.

mrump
14-Alexandrite
(To:tdalon)

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

tdalon
4-Participant
(To:mrump)

Yes! I've written a script in Matlab to create intelligent Word Templates using Word ActiveX.

MKS_Gateway.png

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.)

mrump
14-Alexandrite
(To:tdalon)

.. (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

Top Tags