Assessing the capabilities of the LINQ Reporting Engine

Dear Aspose.Words Team,
we are currently evaluating Aspose.Words for Java for reporting purposes. We tried the Mail Merge feature.
It is a great feature. We found out, that Aspose also provides a reporting engine. We are currently assessing the capabilities of the engine. After a first test, it seems that the engine is not mature enough for production purpose. I designed a simple template document. In the document, I had the following tag:

<<[ds.getCompany().getServices().sum(service => service.getPrice())]>>

I got the following error:
Exception in thread “main” java.lang.IllegalStateException: An error has been encountered at the end of expression ‘ds.getCompany().getServices().sum(service => service.getPrice())]>’. Can not resolve method ‘sum’ on type ‘interface java.util.List’.

Wenn I removed the above tag from the template, I could generate a PDF file. But, in the generated file, some tags were not processed by the engine. What are your recommendations concerning the engine ?
I might also be that I still need to learn how to use the API.
Many Thanks
Juniorfiles.zip (92.0 KB)

@lekanenimpa,

Please also ZIP and attach a simplified Java application (source code without compilation errors) that helps us to reproduce this problem on our end. Thanks for your cooperation.

P.S. To learn about LINQ Reporting Engine, please refer to the following section of documentation:
LINQ Reporting Engine Programmers Guide

Hi,
here is the simple application I used to evaluate the LINQ engine.demo.zip (89.8 KB)

@lekanenimpa,

We are working on your query and will get back to you soon.

@lekanenimpa,

The issue appears because LINQ Reporting Engine currently does not support the sum extension method over BigDecimal. To support BigDecimal, we have logged a new issue in our issue tracking system. The ID of this issue is WORDSJAVA-2009. We will further look into the details of this problem and will keep you updated on the status of this issue. We apologize for your inconvenience.

There are two options to workaround this at the moment:

  • Either change the return type of Service.getPrice() from BigDecimal to double (or java.lang.Double)
  • Or change the template expression to <<[ds.getCompany().getServices().sum(service => service.getPrice().doubleValue())]>>

Hope, this helps.

Hi @awais.hafeez,

I am going to try the options you have mentioned. Thank you for that.
But, what about the tags that were not processed by the engine ?

@lekanenimpa,

The problematic tags are located within SDT (Content Control), which is forbidden by the engine as per the following article:
Template Syntax in Java|Aspose.Words for Java.

Here is a relevant quote: “A tag body must not be located inside markup document nodes such as StructuredDocumentTag, CustomXmlMarkup, or SmartTag.”

So, to handle the issue, the tags should be moved out of SDT, then everything should work.

I have attached a modified document here for your reference:
LINQTemplate-modified.zip (35.6 KB)

Hi @awais.hafeez,

I did not notice that the tags were located within SDT. Thank you for the remark.
I corrected the template. Now, it is working as I want it.

Best regards

@lekanenimpa,

Thanks for your feedback. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Hi @awais.hafeez,

what approach does the Aspose team officially recommend for reporting: Mail Merge or the LINQ Engine ?

@lekanenimpa,

Well, it depends on your needs. We have many customers who use Mail Merge. But, both engines have different feature set. The standard Mail Merge engine of Aspose.Words operates on MS Word’s merge fields. Mail Merge is a feature of Microsoft Word for quickly and easily creating documents like letters, labels and envelopes. For more details, please check:
About Mail Merge

LINQ Reporting Engine is more advanced and offers extended set of reporting features. If you find something which is not possible with Mail Merge then you can use LINQ Reporting Engine. So, it entirely depends upon your requirements.