mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-11-29 18:38:08 +08:00
Add docs for template formulas (#622)
* add template formula example images * add template formula example to readme * add template formula example to readme
This commit is contained in:
parent
1caf3fee3b
commit
1cab06e464
20
README.md
20
README.md
@ -959,9 +959,27 @@ var value = new Dictionary<string, object>()
|
||||
};
|
||||
MiniExcel.SaveAsByTemplate(path, templatePath, value);
|
||||
```
|
||||
#### 10. Formulas
|
||||
|
||||
##### 1. Example
|
||||
Prefix your formula with `$` and use `$enumrowstart` and `$enumrowend` to mark references to the enumerable start and end rows:
|
||||
|
||||
![image](docs/images/template-formulas-1.png)
|
||||
|
||||
When the template is rendered, the `$` prefix will be removed and `$enumrowstart` and `$enumrowend` will be replaced with the start and end row numbers of the enumerable:
|
||||
|
||||
![image](docs/images/template-formulas-2.png)
|
||||
|
||||
##### 2. Other Example Formulas:
|
||||
|
||||
| | |
|
||||
|------------|-----------------------------------------------------------------------------------------|
|
||||
|Sum |`$=SUM(C{{$enumrowstart}}:C{{$enumrowend}})` |
|
||||
|Alt. Average|`$=SUM(C{{$enumrowstart}}:C{{$enumrowend}}) / COUNT(C{{$enumrowstart}}:C{{$enumrowend}})`|
|
||||
|Range |`$=MAX(C{{$enumrowstart}}:C{{$enumrowend}}) - MIN(C{{$enumrowstart}}:C{{$enumrowend}})` |
|
||||
|
||||
|
||||
#### 10. Other
|
||||
#### 11. Other
|
||||
|
||||
##### 1. Checking template parameter key
|
||||
|
||||
|
BIN
docs/images/template-formulas-1.png
Normal file
BIN
docs/images/template-formulas-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
BIN
docs/images/template-formulas-2.png
Normal file
BIN
docs/images/template-formulas-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user