Generating Report using Multiple Data Sources in Word Processing Document
In this article, we will use GroupDocs.Assembly to generate a report. This report will fetch data from multiple data sources.
The code uses some of the objects defined in The Business Layer.
Generating Report in Microsoft Word Document
Creating a Template
- Add a bullet list at the place where you want it to display clients’ names.
- Insert a table with two columns, that will show managers’ and their contact prices.
- Save your Document
Reporting Requirement
As a report developer, you are required to generate a report that fetches data from two different data sources (e:g custom object, excel data table). Report must show following information:
- Bulleted list of clients
- A table showing managers’ along with their contract prices and sum of contract prices
Adding Syntax to be evaluated by GroupDocs.Assembly Engine
We provide support for the following clients:
- <<foreach [in getClients()]>><<[getName()]>>
<</foreach>>
Total Contract Prices by Managers
Manager | Total Contract Price |
---|---|
«foreach [group in contracts .groupBy(c => c.Manager) .orderBy(g => g.key)]» «[group.key]» | «[group.sum( c => c.Contract_Price)]» «/foreach» |
Download Template
Get template from here: