Skip to content

Commit 8ab208c

Browse files
authored
Update README.md
1 parent 0e737c6 commit 8ab208c

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Ultra lightweight spreadsheet utility to display processed collections of data a
44
![license](https://img.shields.io/github/license/planktomas/spreadsheetutility.svg)
55
![GitHub release (latest by date)](https://img.shields.io/github/v/release/planktomas/spreadsheetutility)
66

7-
#### Features
7+
### Features
88
+ Uses XLSX file format
99
+ Writes public properties of a collection into a dedicated sheet
1010
+ Reads sheet data into an enumerator(List)
@@ -16,7 +16,7 @@ Ultra lightweight spreadsheet utility to display processed collections of data a
1616
+ Supports color scale formatting
1717
+ Supports horizontal and vertical data layout
1818

19-
#### Tutorial
19+
### Tutorial
2020

2121
Let's create an employee class to store in a spreadsheet.
2222

@@ -83,8 +83,8 @@ using (var spreadsheet = new Spreadsheet("Company.xlsx"))
8383

8484
[You can review the whole tutorial here](https://github.com/Planktomas/SpreadsheetUtility/blob/main/Tutorial/Program.cs)
8585

86-
#### Additional features
87-
86+
### Additional features
87+
#### Layout
8888
By default all sheets will have a horizontal data layout but we can change it to vertical using Layout attribute.
8989

9090
```cs
@@ -112,3 +112,39 @@ class Employee
112112
Here is how it looks in the spreadsheet.
113113

114114
<img src="https://github.com/Planktomas/SpreadsheetUtility/assets/94010480/7aff29ad-88f5-413e-8be6-bb6d73773327.png" width="700" height="160" />
115+
116+
#### Hidden attribute
117+
118+
If there is no need to export a property to the spreadsheet we can exclude it via Hidden attribute.
119+
120+
```cs
121+
class Employee
122+
{
123+
[Hidden]
124+
public string? Name { get; set; }
125+
public string? Position { get; set; }
126+
...
127+
}
128+
```
129+
130+
<img src="https://github.com/Planktomas/SpreadsheetUtility/assets/94010480/853d573e-a25a-40e3-a65a-5c50c7ddbcbc.png" width="360" height="180" />
131+
132+
#### Formula
133+
134+
Sometimes we want to have cells that update in real time or react to the changes we make in the spreadsheet. For this case we can use formulas. Keep in mind though that formulas can only reference properties in the same line. Also note that we don't declare a setter for formula property as we don't really need to read the formula back.
135+
136+
```cs
137+
138+
class Employee
139+
{
140+
...
141+
[Format("0$")]
142+
[ColorScale("red", "#00FF00" /* green */)]
143+
public decimal Salary { get; set; }
144+
145+
public string DesiredSalary => $"= {nameof(Salary)} * 2";
146+
...
147+
}
148+
```
149+
150+
<img src="https://github.com/Planktomas/SpreadsheetUtility/assets/94010480/1440bcbf-e5b4-417b-be68-80d2a64afd5a.png" width="400" height="180" />

0 commit comments

Comments
 (0)