Sunday 26 April 2020

How to hide a table based on condition in rtf templates

How to hide a table based on condition in rtf templates

In this post , We will be discuss about how to hide a table based on condition in rtf templates. We will try to hide a table in the rtf template using the 'if 'condition. We have the rtf features like 'if' condition with the help of this , we can hide a table based on condition in rtf templates. We just need to use the 'if' condition in the right place to conditionally display the table in the rtf templates. This helps to display the tables based on condition in rtf templates. Using if else in rtf template we can can dynamically control the layout structure of the rtf templates. If else helps to meet the conditional business layout requirements in rtf template. Here below we will be discuss in more about How to hide a table based on condition in rtf templates.

2 Methods to hide a table based on condition in rtf templates

1st Method: 

<?IF?>

<?END IF?>

2nd Method: 

<?xdofx:if element_condition then result1 else result2 end if?>

Working Example to hide a table based on condition in rtf templates

Here in the below Example , P_FLAG is the XML attribute. Whose value is changing as per the report output.

Here we can trying to put condition if _FLAG='Y' then 'Discount' will print , otherwise This above row will be hide.

Under IF , we have written this below script '<?if:P_FLAG='Y'?> ' and in ENDIF We have put '<?end if?>'



We need to end the If condition using '<?end if?>' script.

How to hide a table based on condition in rtf templates
How to hide a table based on condition in rtf templates


0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *