Skipif status


#1

I am evaluating Aspose.Word for .NET (19.4) for our project and found out that mergefield skipif is not evaluated. Does most recent Aspose.Word for .NET support conditional mail merging?


#2

@minghe

Yes, Aspose.Words does support SKIPIF with mail merge. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • 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.


#3

Hi Tahir,

Since our steak holders want to make a decision asap, I am not going to wait for your response before sending my files to you. If you tell me, I will upload according to your instruction after receiving it.

Attached is the zipped file that contains the files you are looking for. In the attached zipped file of “sendToAspose.zip”, I have the following files:

  1. DocumentTest.zip – Test source code to do mail merge of word document, attached another word document to it, and then finally convert to pdf.
  2. test.docx – Word document template with merge fields and conditional merge fields such as skipif.
  3. test2.docx – Word document that is attached to the test.docx in the source code above.
  4. ExpectedOutput.pdf – We expect all the conditional merge fields are evaluated. (We fake the result by removing all the unevalued conditional fields in the code to just give you an idea of what we expect.)
  5. Output.pdf – This is the pdf converted by the test application in the zip file of DocumentTest.zip. As you can see and as I pasted in the following, the conditional fields are not evaluated by Aspose.PDF for .NET.

Regards,

Ming


#4

@minghe

Unfortunately, we have not found the ZIP file with your post. If file size of ZIP file is greater than 10 MB, you can attach ZIP files for each document separately. You may also share the requested detail via Dropbox.


#5

HI Tahir, I reduced the file size and send to you again.SendToAspose.zip (505.7 KB)


#6

@minghe

Thanks for sharing the detail. We are investigating this issue and will get back to you soon.


#7

@minghe

The syntax of SKIPIF field is as follow. In your case, the Expression1 should be mail merge field i.e. Amount.

{ SKIPIF Expression1 Operator Expression2 }

The SKIPIF field does not work in your case because you want to skip the whole record i.e. one row of DataTable

In your case, we suggest you please use the IF field as shown below. Hope this helps you.


#8

Thank you for uncovering the issue. Just for further ease of reference by others, could you please make sure the image with your recommended formula field is displayable? It currently shows nothing.


#9

@minghe

The image is visible. We have created a sample document for same case and attached it with this post for your kind reference. Hope this helps you.

sample document.zip (9.6 KB)