Skip to content

Commit eb061bc

Browse files
committed
2 parents d3d331d + b3e1097 commit eb061bc

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
11
# ExcelReportGenerator
22

3-
This library allows you to render data to Microsoft Excel by marking Excel sheets using panels and templates. It allows you easily connecting to various data sources like IDataReader, DataSet, DataTable, IEnumerable<T>, etc, and render data from them to Excel. You can also apply to the data an aggregation, different types of grouping, formatting, etc. You can include the library to your project via [NuGet package](https://www.nuget.org/packages/ExcelReportGenerator). The detailed documentation is inside the Docs folder. There is also the project with samples.
3+
This library allows you to render data to Microsoft Excel by marking Excel sheets using panels and templates. It allows you easily connecting to various data sources like IDataReader, DataSet, DataTable, IEnumerable<T>, etc, and render data from them to Excel. You can also apply to the data an aggregation, different types of grouping, formatting, etc. You can include the library to your project via [NuGet package](https://www.nuget.org/packages/ExcelReportGenerator).
4+
5+
## How to use?
6+
First of all you have to create a report template in Microsoft Excel. You need to mark up an excel sheet (or multiple sheets) using panels and templates which will be handled by the library. You can add any other formatting you want. All styles will be preserved after rendering. Your template can look like this:
7+
8+
**Template**
9+
10+
![template](https://user-images.githubusercontent.com/45209977/48908282-e29a8b80-ee7a-11e8-9b54-6997ba617474.png)
11+
12+
Next you need to create a report class that will supply data for this template
13+
14+
**Code**
15+
16+
```c#
17+
public class ReportSample
18+
{
19+
private readonly DataProvider _dataProvider = new DataProvider();
20+
21+
public string ReportName => "Grouping with Panel Hierarchy";
22+
23+
public IEnumerable<string> GetDepartments()
24+
{
25+
return GetAllEmployees().Select(e => e.DepartmentName).Distinct();
26+
}
27+
28+
public IEnumerable<DataProvider.Result> GetDepartmentEmployees(string department)
29+
{
30+
return GetAllEmployees().Where(e => e.DepartmentName == department).ToArray();
31+
}
32+
33+
public IEnumerable<DataProvider.Result> GetAllEmployees()
34+
{
35+
return _dataProvider.GetEmployeesAsIEnumerable().ToArray();
36+
}
37+
38+
public string ConvertGender(string gender)
39+
{
40+
return gender == "M" ? "Male" : "Female";
41+
}
42+
}
43+
```
44+
45+
**Result**
46+
47+
![result](https://user-images.githubusercontent.com/45209977/48908531-94d25300-ee7b-11e8-8022-5c6cfdfca4e3.png)
48+
49+
The detailed documentation is inside the Docs folder. For more information see also ExcelReportGenerator.Samples.

0 commit comments

Comments
 (0)