Aspose linq reporting engine - Merge fails when we have a less than (<) or greater than (>) symbols around content controls

Hi Team,
We are using Aspose Linq Reporting Engine for merge operation.

e.g.

Engine.BuildReport
(
    template.Content,
    dataSources,
    dataSourceNames
);

When we are having less than “<” or greater than “>” symbol around the content control then its failing with below error.

System.InvalidOperationException: Character '<' is unexpected.
   at yM.d(ml d, ll v, Hl c, Boolean t, zM n, Boolean B)
   at yM.yMiFd(ml d, ll v, Hl c, Boolean t)
   at hM.d(String[] d, Object[] v, Ll c, ml t, ll n, Hl B)
   at hM.d(String[] d, Object[] v, ll c, Hl t)
   at Aspose.Words.Reporting.ReportingEngine.BuildReport(Document document, Object[] dataSources, String[] dataSourceNames)

I have attached the sample aspose template for reference.

AsposeTemplate.docx (17.8 KB)

Do we have any way to handle this kind of issues from aspose side?

Thanks,
Rajmal

@RajmalConga

The error you are encountering with the Aspose LINQ Reporting Engine when using less than (<) or greater than (>) symbols around content controls is likely due to the engine interpreting these characters as unexpected tokens. This can happen because the reporting engine expects specific syntax for its placeholders and may not handle these symbols correctly.

To resolve this issue, you can try the following approaches:

  1. Escape the Symbols: If you need to include < or > in your content controls, consider escaping them. For example, you can use &lt; for < and &gt; for >. This way, the reporting engine will treat them as plain text rather than special characters.

  2. Use Alternative Syntax: If the symbols are not essential, consider using alternative syntax or characters that do not conflict with the reporting engine’s parsing logic.

  3. Check for Updates: Ensure that you are using the latest version of the Aspose library, as updates may include fixes for issues related to parsing and handling special characters.

  4. Review Documentation: Consult the Aspose documentation for any specific guidelines on using special characters within content controls. There may be additional recommendations or best practices that can help avoid this issue.

If these suggestions do not resolve the problem, you may want to reach out to Aspose support with a detailed description of your issue, including the specific template you are using, to get more tailored assistance.

For further reference, you can check the following resources:

If you have any more questions or need further assistance, feel free to ask!

@RajmalConga
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27969

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@RajmalConga

This is expected behavior rather than a bug. Character sequence “<<” is reserved by LINQ Reporting Engine template syntax to denote a tag start, after which, a proper tag name is expected. So, if using the engine, the restriction must be followed.

As a workaround, you can change your template to something like <-<-<<[value]>>->-> and then assign a hidden font to the dash characters.