Issue with IF Condition in Child Template After Upgrading to Aspose.Words 25.5

Dear Support Team,

I am currently using Aspose.Words to generate documents and recently upgraded from version 4.2.1.0 to 25.5. After the upgrade, I encountered an issue related to the IF condition used in a child template. The same logic was working correctly in the earlier version but now seems to be failing or behaving unexpectedly.

Could you please assist in identifying whether there have been any changes in the syntax or behavior of conditional logic (IF, ELSE, etc.) in child templates between these versions?

Below is the condition used in my child template

<# pardef: “PaymentTerms” /#>
<# if: “TermsAndConditionDetailTypeID” = “13” /#>
<# subfieldval: “StagePayment” /#>% <# subfieldval: “TermsAndConditionDetailDescription” /#>
<# endif /#>
<# endpardef /#>

Looking forward to your guidance.

@XECOM

It appears that you are experiencing issues with the IF condition in your child template after upgrading to Aspose.Words version 25.5. Unfortunately, I couldn’t find specific information regarding changes in the syntax or behavior of conditional logic in child templates between versions 4.2.1.0 and 25.5.

However, it is worth noting that the release notes for version 25.5 highlight various enhancements and new features, but they do not explicitly mention any modifications to the conditional logic syntax. This suggests that the issue may not be related to a documented change in the API.

To troubleshoot the problem, I recommend checking the following:

  1. Syntax Verification: Ensure that the syntax used in your IF condition is still valid in the new version. Sometimes, minor changes in whitespace or quotation marks can lead to unexpected behavior.

  2. Testing with Simplified Conditions: Try simplifying the condition to see if it behaves correctly with basic logic. For example, test a straightforward IF statement without additional subfield values.

  3. Reviewing Release Notes: While the release notes do not mention conditional logic changes, reviewing the notes for any related features or enhancements might provide insights into other changes that could affect your template processing.

  4. Community Forums: Consider reaching out on community forums or support channels for Aspose.Words, as other users may have encountered similar issues and could offer solutions or workarounds.

If you continue to face difficulties, providing a minimal reproducible example of the issue might help in diagnosing the problem further.

Sources:
[1]: What’s new in Aspose.Words for .NET - Aspose Documentation

@XECOM Aspose.Words does not have such reporting syntax. You can consider using either clastic Mail Merge feature and standard MS Word IF fields. Or LINQ Reporting Engine and it’s syntax.

Thank you for your response regarding the unsupported syntax in Aspose.Words 25.5.

I would like to clarify that the syntax I mentioned (e.g., <# if: “TermsAndConditionDetailTypeID” = “13” /#>) was working correctly in version 4.2.1.0 of Aspose.Words. It was used in our child templates for conditional logic and document generation.

Could you please confirm:

  1. Was this syntax part of a legacy feature or a deprecated templating engine in earlier versions of Aspose.Words?
  2. If so, is there any documentation or migration guide available to help convert such templates to the currently supported LINQ Reporting Engine or Mail Merge syntax?
  3. Are there any compatibility options or fallback mechanisms in the newer versions to support legacy templates?

@XECOM

If I remember properly we did not provide such syntax in old versions of Aspose.Words. The first reporting feature, which was provided by Aspose.Words was classic Mail Merge feature. Could you please provide your sample template and code used on your side?

No, there is no migration guide.

No, there are no such options.