Appendix C. Typical Templates
This section contains examples of templates for typical scenarios. Every example is given using one of the following data source objects:
manager
, an instance of theManager
classmanagers
, an enumeration of instances of theManager
classcontracts
, an enumeration of instances of theContract
classclients
, an enumeration of instances of theClient
class
The Manager
, Contract
, and Client
classes are defined as follows.
public class Manager
{
public String Name { get { ... } }
public int Age { get { ... } }
public byte[] Photo { get { ... } }
public Country Country { get { ... } }
public IEnumerable<Contract> Contracts { get { ... } }
...
}
public class Country
{
public String Name { get { ... } }
...
}
public class Contract
{
public Manager Manager { get { ... } }
public Client Client { get { ... } }
public float Price { get { ... } }
public DateTime Date { get { ... } }
...
}
public class Client
{
public String Name { get { ... } }
...
}
Single-Row Template
Template Example
Name: <<[manager.Name]>> Age: <<[manager.Age]>> |
---|
Report Example
Name: John Smith Age: 37 |
---|
In-Paragraph List Template
Template Example
We provide support for the following clients: <<foreach [in clients]>><<[IndexOf() != 0 ? “, ” : “”]>><<[Name]>><</foreach>>
Report Example
We provide support for the following clients: A Company, B Ltd., C & D, E Corp., F & Partners, G & Co., H Group, I & Sons, J Ent.
Bulleted List Template
Template Example
We provide support for the following clients:
* <<foreach [in clients]>><<[Name]>>
<</foreach>>
Report Example
We provide support for the following clients:
* A Company
* B Ltd.
* C & D
* E Corp.
* F & Partners
* G & Co.
* H Group
* I & Sons
* J Ent.
Numbered List Template
Template Example
We provide support for the following clients:
1. <<foreach [in clients]>><<[Name]>>
<</foreach>>
Report Example
We provide support for the following clients:
1. A Company
2. B Ltd.
3. C & D
4. E Corp.
5. F & Partners
6. G & Co.
7. H Group
8. I & Sons
9. J Ent.
Multicolored Numbered List Template
Template Example
We provide support for the following clients: 1. <<foreach [in clients]>><<if [IndexOf() % 2 == 0]>><<[Name]>> 2. <<else>><<[Name]>> <</if>><</foreach>> |
Report Example
We provide support for the following clients: 1. A Company 2. B Ltd. 3. C & D 4. E Corp. 5. F & Partners 6. G & Co. 7. H Group 8. I & Sons 9. J Ent. |
Common List Template
Template Example
<<foreach [in managers]>> <<[Name()]>> <</foreach>> |
---|
Report Example
John Smith Tony Anderson July James |
---|
In-Table List Template
Template Example
Manager | Contract Price |
---|---|
|
|
|
|
Report Example
Manager | Contract Price |
---|---|
John Smith | 2300000 |
Tony Anderson | 1200000 |
July James | 800000 |
Total: | 4300000 |
In-Table List Template (Horizontal)
Template Example
Manager | <<foreach [in managers] -horz>><<[Name]>> | Total: |
Contract Price | <<[Contracts.Sum( c => c.Price)]>><</foreach>> | <<[Sum( m => m.Contracts.Sum( c => c.getPrice()))]>> |
Report Example
Manager | John Smith | Tony Anderson | July James | Total: |
---|---|---|---|---|
Contract Price | 2300000 | 1200000 | 800000 | 4300000 |
In-Table List Template with Running (Progressive) Total
Template Example
<<var [total = 0.0]>> | |
Client | Total Contract Price |
<<foreach [in contracts]>><<[Client.Name]>> | <<var [total = total + Price]>><<[total]>><</foreach>> |
Report Example
Client | Total Contract Price |
---|---|
A Company | 1200000 |
B Ltd. | 1950000 |
C & D | 2300000 |
E Corp. | 2950000 |
F & Partners | 3500000 |
G & Co. | 3850000 |
H Group | 4100000 |
I & Sons | 4200000 |
J Ent. | 4300000 |
In-Table List Template with Highlighted Rows
Template Example
Client | Contract Price |
<<foreach [in contracts]>><<if [Price >= 1000000]>><<[Client.Name]>> | <<[Price]>> |
<<else>><<[Client.Name]>> | <<[Price]>><</if>><</foreach>> |
Total: | <<[Sum(c => c.Price)]>> |
Report Example
Client | Contract Price |
A Company | 1200000 |
B Ltd. | 750000 |
C & D | 350000 |
E Corp. | 650000 |
F & Partners | 550000 |
G & Co. | 350000 |
H Group | 250000 |
I & Sons | 100000 |
J Ent. | 100000 |
Total: | 4300000 |
In-Table List Template (Horizontal) with Highlighted Columns
Template Example
Manager | <<foreach [in managers] -horz>><<if [Contracts.Sum( c => c.Price) >= 2000000] -horz>><<[Name]>> | <<else>><<[Name]>> | Total: |
Contract Price | <<[Contracts.Sum( c => c.Price)]>> | <<[Contracts.Sum( c => c.Price)]>><</if>><</foreach>> | <<[Sum( m => m.Contracts.Sum( c => c.Price))]>> |
Report Example
Manager | John Smith | Tony Anderson | July James | Total: |
Contract Price | 2300000 | 1200000 | 800000 | 4300000 |
In-Table List Template with Alternate Content
Template Example
Client | Contract Price |
<<if [!Any()]>>No data | |
<<else>><<foreach [in contracts]>><<[Client.Name]>> | <<[Price]>><</foreach>> |
Total: | <<[Sum(c => c.Price)]>><</if>> |
Report Example 1
Client | Contract Price |
No data |
Report Example 2
Client | Contract Price |
---|---|
A Company | 1200000 |
B Ltd. | 750000 |
C & D | 350000 |
E Corp. | 650000 |
F & Partners | 550000 |
G & Co. | 350000 |
H Group | 250000 |
I & Sons | 100000 |
J Ent. | 100000 |
Total: | 4300000 |
In-Table List Template (Horizontal) with Alternate Content
Template Example
Manager | <<if [!Any()] -horz>>No data | <<else>><<foreach [in managers] -horz>><<[Name]>> | Total: |
Contract Price | <<[Contracts.Sum( c => c.Price)]>><</foreach>> | <<[Sum( m => m.Contracts.Sum( c => c.Price))]>><</if>> |
Report Example 1
Client | No data |
Contract Price |
Report Example 2
Manager | John Smith | Tony Anderson | July James | Total: |
---|---|---|---|---|
Contract Price | 2300000 | 1200000 | 800000 | 4300000 |
Common Master-Detail Template
Template Example
<<foreach [in managers]>> <<[Name()]>> Clients: <<foreach [in Contracts() ]>><<[indexOf() != 0 ? “, " : “"]>><<[Client().Name()]>><</foreach>> <</foreach>> |
---|
Report Example
John Smith Clients: A Company, B Ltd., C & D Tony Anderson Clients: E Corp., F & Partners July James Clients: G & Co., H Group, I & Sons, J Ent. |
---|
In-Table Master-Detail Template
Template Example
Manager/Client | Contract Price |
---|---|
|
|
|
|
|
|
Report Example
Manager/Client | Contract Price |
---|---|
John Smith | 2300000 |
A Company | 1200000 |
B Ltd. | 750000 |
C & D | 350000 |
Tony Anderson | 1200000 |
E Corp. | 650000 |
F & Partners | 550000 |
July James | 800000 |
G & Co. | 350000 |
H Group | 250000 |
I & Sons | 100000 |
J Ent. | 100000 |
Total: | 4300000 |
Pie Chart Template
Template Example
Initial Chart Series Data
Report Example
Sunburst Chart Template
Template Example
Initial Chart Series Data
Report Example
Treemap Chart Template
Template Example
Initial Chart Series Data
Report Example
Histogram Chart Template
Template Example
Report Example
Scatter Chart Template
Template Example
Initial Chart Series Data
Report Example
Bubble Chart Template
Template Example
Initial Chart Series Data
Report Example
In-Table Template with Filtering, Grouping, and Ordering
Template Example
Manager | Contract Price |
---|---|
|
|
Report Example
Manager | Contract Price |
---|---|
John Smith | 2300000 |
July James | 800000 |
Tony Anderson | 1200000 |
Chart Template with Filtering, Grouping, and Ordering
Template Example
Report Example