Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated auto_filter example to include documentation on the offsettin…
…g the auto filter start row
  • Loading branch information
athena-metis committed Aug 25, 2018
commit f25c54c5b5ad9af3a1f135d0dd191d51b609ee6e
14 changes: 13 additions & 1 deletion examples/ex09-autofilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
$chars = 'abcdefgh';

$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', array('col-string'=>'string','col-numbers'=>'integer','col-timestamps'=>'datetime'), ['auto_filter'=>true, 'widths'=>[15,15,30]] );

/**
* auto_filter may also be set to numbers greater than 1 to offset the
* start row for the auto filter data range. This will have the effect
* of changing the start row for the data to be filtered and there-by
* the row the dropdown filters show on to the row number specified
* in this option.
*/
$writer->writeSheetHeader(
'Sheet1',
['col-string'=>'string', 'col-numbers'=>'integer', 'col-timestamps'=>'datetime'],
['auto_filter'=>1, 'widths'=>[15, 15, 30]]
);
for($i=0; $i<1000; $i++)
{
$writer->writeSheetRow('Sheet1', array(
Expand Down