How can I achieve multiplication in template for LINQ Reporting Engine? Let’s say I have 2 values read from datasource <<[ProductAAmount]>> and <<[ProductBAmount]>>. I can render/see them correctly on files that I generate from the template. What is the syntax to multiply these values together and to get that value to render? You can find example document attached to this post. testReport_v1.docx (37.5 KB)
Another question would be how can I format percentage decimals the way I want?
One more question came to mind. I have managed to multiply the values using the syntax you provided. How can I Sum the multiplied totals together? Or what is syntax for it? I have attached updated example heretestReport_v1.docx (38.2 KB)
You can use LINQ extension methods directly in template expressions to output aggregate values for collections. The list of supported LINQ extension methods with examples can be found at Enumeration Extension Methods.
In your case, template syntax might be like this: <<[xml.products.productgroups.productgroup.Sum(g => g.ProductAAmount * g.ProductBAmount)]>>.
couple more questions came in. Please find example document attached here.Test_document.docx (15.7 KB) and example xml which we are using to populate the word file here test.zip (270 Bytes)
I have a table and I can calculate values there fine. However, summing the calculated values together to the bottom of the table seems to be a challenge since we are using something on the table itself with the calculations. Do you have any pointers which syntax would solve the problem/can calculate everything together nicely?
We have troubles in building a report from the provided template and data. Maybe, you use an XSD (XML schema) file in addition? Could you please also provide source code you use for building a report? Thanks for your cooperation.
I’m afraid that sharing the source code is not possible, but for me that isn’t the problem as it works and I can access all the values of the XML.
Just wondering about example syntax which could calculate the totals in the “Totals”-row in the example document. All the calculations before the “Totals”-row already work.