Hi,
I am new to the forums so please bear with me.
I am looking to create a foreach table in a word doc which will return ‘NA’ if the table it is pulling from is blank. I also want it to ignore the ‘NA’ if values are present and display the values.
I’ve tried using inverted sections but this still prints if there are values present
http://mustache.github.io/mustache.5.html#Inverted-Sections
For example;
{{ #foreach Customers }}{{ Name }} {{ Surname }}{{ /foreach Customers }}
If there are no customers in the table then I want it to print out ‘NA’.
Any help appreciated
@jmcgrann
In your case, we suggest you please use the LINQ Reporting Engine to achieve your requirement. Please read the following articles.
Template Syntax
Using Conditional Blocks
If you still want to use Mustache syntax, please use the IF field with Mustache template syntax as shown in attached document. input.zip (9.3 KB)
Thanks Tahir
To explain this a bit bettter, I have a table across 4 columns that use a foreach to print out values and I want the document to dislpay an NA value if the table has no values in it.
I’ve attached the example I am using, basically if the row for chairs has zero results then the text in the description field needs to saying ‘NA’.
Test.zip (10.1 KB)
.
@jmcgrann
To ensure a timely and accurate response, please attach the following resources here for testing:
- Please attach the output Word file that shows the undesired behavior.
- Please attach the expected output Word file that shows the desired behavior.
- Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.
PS: To attach these resources, please zip and upload them.