I'm trying to hide a line with a specific item nam...
# advancedpdf
m
I'm trying to hide a line with a specific item name on a Sales Order. I can hide all the string fields using the replace function in Freemarker to replace a string with "" it works great. BUT when I try and do that with a numeric column (rate, amount) the print blows up because "" is a text string and rate and amount are numeric. Any idea how I can accomplish this? Here is the code I tried: <#if item.item?contains("Credit Card Fee")>${item.amount?replace({item.amount?c,"")}(#else${item.amount}</#if></td>. Basically, it is comparing the contents of the item to determine if it should hide the amount field. This item field will always be the last in the loop so maybe instead I could just exit the loop of the sublist items displaying? But don't know how to do that either. Thank you.
t
You could just try <#if !item.item?contains("Credit Card Fee")>${item.amount}</#if> This should skip printing the Item Amount if the Item contains "Credit Card Fee". Basically you want to skip printing anything at all for that item.
No real need for the ELSE, just the NOT of the contains should work
m
Thank you. That is what I ended up doing and it worked great. Then I took it one step further and just had it skip all the columns that were printing so I didn't have to do it on each field. Thanks so much for responding.