Skip to content

Commit

Permalink
Merge pull request #179 from mk-j/2017-12-0.37-r1
Browse files Browse the repository at this point in the history
2017 12 0.37 r1
  • Loading branch information
mk-j authored Jan 11, 2018
2 parents a754190 + 8d09a74 commit c4ba602
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 46 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@ Simple cell formats map to more advanced cell formats

Basic cell styles have been available since version 0.30

| style | allowed values |
| ---------- | ---- |
| font | Arial, Times New Roman, Courier New, Comic Sans MS |
| font-size | 8,9,10,11,12 ... |
| font-style | bold, italic, underline, strikethrough or multiple ie: 'bold,italic' |
| border | left, right, top, bottom, or multiple ie: 'top,left' |
| color | #RRGGBB, ie: #ff99cc or #f9c |
| fill | #RRGGBB, ie: #eeffee or #efe |
| halign | general, left, right, justify, center |
| valign | bottom, center, distributed |
| style | allowed values |
| ------------ | ---- |
| font | Arial, Times New Roman, Courier New, Comic Sans MS |
| font-size | 8,9,10,11,12 ... |
| font-style | bold, italic, underline, strikethrough or multiple ie: 'bold,italic' |
| border | left, right, top, bottom, or multiple ie: 'top,left' |
| border-style | thin, medium, thick, dashDot, dashDotDot, dashed, dotted, double, hair, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDot |
| border-color | #RRGGBB, ie: #ff99cc or #f9c |
| color | #RRGGBB, ie: #ff99cc or #f9c |
| fill | #RRGGBB, ie: #eeffee or #efe |
| halign | general, left, right, justify, center |
| valign | bottom, center, distributed |


3 changes: 2 additions & 1 deletion example-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
array('2003','1','-50.5','2010-01-01 23:00:00','2012-12-31 23:00:00'),
array('2003','=B1', '23.5','2010-01-01 00:00:00','2012-12-31 00:00:00'),
);

$writer = new XLSXWriter();
$writer->setAuthor('Some Author');
$writer->setAuthor('Some Author');
foreach($rows as $row)
$writer->writeSheetRow('Sheet1', $row);

Expand Down
3 changes: 2 additions & 1 deletion example.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
array('2003','1','-50.5','2010-01-01 23:00:00','2012-12-31 23:00:00'),
array('2003','=B1', '23.5','2010-01-01 00:00:00','2012-12-31 00:00:00'),
);

$writer = new XLSXWriter();
$writer->setAuthor('Some Author');
$writer->setAuthor('Some Author');
foreach($rows as $row)
$writer->writeSheetRow('Sheet1', $row);
$writer->writeToStdOut();
Expand Down
7 changes: 7 additions & 0 deletions examples/ex08-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
include_once("xlsxwriter.class.php");

$writer = new XLSXWriter();
$keywords = array('some','interesting','keywords');

$writer->setTitle('Some Title');
$writer->setSubject('Some Subject');
$writer->setAuthor('Some Author');
$writer->setCompany('Some Company');
$writer->setKeywords($keywords);
$writer->setDescription('Some interesting description');
$writer->setTempDir(sys_get_temp_dir());//set custom tempdir

//----
Expand Down
18 changes: 18 additions & 0 deletions examples/ex09-autofilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
set_include_path( get_include_path().PATH_SEPARATOR."..");
include_once("xlsxwriter.class.php");

$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]] );
for($i=0; $i<1000; $i++)
{
$writer->writeSheetRow('Sheet1', array(
str_shuffle($chars),
rand()%10000,
date('Y-m-d H:i:s',time()-(rand()%31536000))
));
}
$writer->writeToFile('xlsx-autofilter.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";
20 changes: 20 additions & 0 deletions examples/ex10-freeze-rows-columns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
set_include_path( get_include_path().PATH_SEPARATOR."..");
include_once("xlsxwriter.class.php");

$chars = 'abcdefgh';

$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', array('c1'=>'string','c2'=>'integer','c3'=>'integer','c4'=>'integer','c5'=>'integer'), ['freeze_rows'=>1, 'freeze_columns'=>1] );
for($i=0; $i<250; $i++)
{
$writer->writeSheetRow('Sheet1', array(
str_shuffle($chars),
rand()%10000,
rand()%10000,
rand()%10000,
rand()%10000
));
}
$writer->writeToFile('xlsx-freeze-rows-columns.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";
7 changes: 7 additions & 0 deletions testbench/pairs/formats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
include_once("../../xlsxwriter.class.php");

$writer = new XLSXWriter();
$keywords = array('some','interesting','keywords');

$writer->setTitle('Some Title');
$writer->setSubject('Some Subject');
$writer->setAuthor('Some Author');
$writer->setCompany('Some Company');
$writer->setKeywords($keywords);
$writer->setDescription('Some interesting description');

$header = array(
'General'=>'string',
Expand Down
7 changes: 7 additions & 0 deletions testbench/pairs/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
include_once("../../xlsxwriter.class.php");

$writer = new XLSXWriter();
$keywords = array('some','interesting','keywords');

$writer->setTitle('Some Title');
$writer->setSubject('Some Subject');
$writer->setAuthor('Some Author');
$writer->setCompany('Some Company');
$writer->setKeywords($keywords);
$writer->setDescription('Some interesting description');

$header = array(
'General'=>'string',
Expand Down
7 changes: 7 additions & 0 deletions testbench/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
array('2003','02','345.12'),
);
$writer = new XLSXWriter();
$keywords = array('some','interesting','keywords');

$writer->setTitle('Some Title');
$writer->setSubject('Some Subject');
$writer->setAuthor('Some Author');
$writer->setCompany('Some Company');
$writer->setKeywords($keywords);
$writer->setDescription('Some interesting description');
$writer->writeSheet($data1,'Sheet1',$header);
$writer->writeSheet($data2,'Sheet2');
$writer->writeToFile('test.xlsx');
Expand Down
Loading

0 comments on commit c4ba602

Please sign in to comment.