Forum Discussion
Code to hide lines where the MergeField is Zero, using IF
Hi.
I use software called WorkflowMax which uses MSWord format for custom Invoice Templates. There is a type of Invoice which shows several columns of data for each item on the invoice inlcuded Original Quoted Price, what was Previously Claimed, what's being claimed on the current invoice, and what is remaining as outstanding.
I have managed to work out the code to not show a "0.00" for any particular field when the value of the field is Zero so that part is all good. As below in the third line where there is no "Claimed Incl This Invoice" for the Task "Consulting RMA Ecology", nothing prints.
However, I need conditional code so that I can not show all 4 columns of a specific line, if just one of those columns is Zero. ie. if Nothing is being claimed on part of the quote in an invoice, then I don't want to print the other columns for that line, which do still have values (Task Name / Quoted / Previously Claimed/ Claimed Incl This Invoice / Balance Remaining). So as an example, to not show the Quoted column it will need to look and see if there is a zero value in the "This Invoice" column. I've really had a go with it but just can't make it work!
helens63 Are you saying that you want to conditionally hide some of the columns, INCLUDING the header of the column. If that is the case, you will need to conditionally display variations of the table with each variation only containing the wanted columns.
- helens63Copper Contributor
Doug_Robbins_Word_MVP Hi Doug, thank you for entering this conversation. My understanding of the terminology might be incorrect. When you say the header row I'm thinking that means the titles, or the first row of the table. I don't want to hide that. It will be fine to display the header row, even if some of the rows underneath are empty. But for any particular row, if the Current Claim is 0, then we don't want to display anything on that row. I've found it easy enough to stop the Current Claim part not showing, but not the other columns for that row. The owner is thinking that if there is no Current Claim for part of the Quote, then he doesn't want to show the original Quoted price, what's been claimed before and what's still outstanding for that particular part of the quote, on that invoice.
helens63 Sorry, I have not been able to determine exactly what the criteria is, which might be me, or it might be because you have used a term "Current Claim", rather than the relevant MergeField name. Can you re-phrase the requirement, making use of the actual MergeField names.
I am not sure how WorkflowMax processes the data, but the Many to One facility of my MergeTools Add-in, which can be used from creating output for items such as a multi-line invoice, the test for a field that is empty must be for " " rather than "".