mirror of
https://github.com/shuchkin/simplexlsxgen.git
synced 2023-08-10 21:12:59 +03:00
1.2.16
This commit is contained in:
parent
aef6ee4935
commit
82b0db1f8e
@ -1,4 +1,10 @@
|
||||
# Changelog
|
||||
## 1.2.16 (2022-08-06)
|
||||
* added modTemplate( $path, $custom_xml ) for customize generated XML
|
||||
```php
|
||||
$xlsx->modTemplate('xl/worksheets/sheet1.xml', '<autoFilter ref="A1:A5"/>');
|
||||
```
|
||||
|
||||
## 1.2.15 (2022-07-05)
|
||||
* added wrap words in long strings `<wraptext>long long line</wraptext>`
|
||||
|
||||
|
@ -104,6 +104,10 @@ $xlsx->addSheet( $books, 'Catalog 2021' );
|
||||
$xlsx->addSheet( $books2, 'Stephen King catalog');
|
||||
$xlsx->downloadAs('books_2021.xlsx');
|
||||
exit();
|
||||
|
||||
// Customize XML
|
||||
$xlsx->modTemplate('xl/worksheets/sheet1.xml', '<autoFilter ref="A1:A5"/>');
|
||||
|
||||
```
|
||||
### JS array to Excel (AJAX)
|
||||
```php
|
||||
|
@ -768,6 +768,11 @@ class SimpleXLSXGen {
|
||||
$this->defaultFontSize = $size;
|
||||
return $this;
|
||||
}
|
||||
public function modTemplate( $path, $custom_xml ) {
|
||||
$t = $this->template[ $path ];
|
||||
$p = strrpos($t,'</');
|
||||
return $this->template[ $path ] = substr($t, 0, $p) . $custom_xml . substr($t,$p);
|
||||
}
|
||||
public function mergeCells( $range ) {
|
||||
$this->sheets[$this->curSheet]['mergecells'][] = $range;
|
||||
return $this;
|
||||
|
Loading…
Reference in New Issue
Block a user