Free Support Forum - aspose.com

Assessing the capabilities of the LINQ Reporting Engine


#1

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)


#2

@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


#3

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


#4

@lekanenimpa,

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


#5

@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.


#6

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 ?


#7

@lekanenimpa,

The problematic tags are located within SDT (Content Control), which is forbidden by the engine as per the following article:
https://docs.aspose.com/display/wordsjava/Template+Syntax.

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)


#8

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


#9

@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.