From bf80538aa04fb100c2b0637775bf77e12c81aac4 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 29 Apr 2013 17:26:05 +0100 Subject: [PATCH] Updated documentation with Autofilter execution, and provided an example script --- ...lter Reference developer documentation.doc | Bin 629760 -> 635904 bytes Examples/10autofilter-selection-display.php | 198 ++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 Examples/10autofilter-selection-display.php diff --git a/Documentation/PHPExcel AutoFilter Reference developer documentation.doc b/Documentation/PHPExcel AutoFilter Reference developer documentation.doc index 85f7e420976fa4643a4ba680616006e0b2338210..2a4a1d94048d8802beb8a5b17e6f2b8b9a37ba18 100644 GIT binary patch delta 17155 zcmciK2YeLOzQFObn*?@&rG^&T(h@=m0g@0vB!N(+S1AEPSV$m^6gn(TsvvNXMFgpG zEuc~~g7m6_p%+mQK@=%h5D~EPerIMUY(n7ad+)x@=esj=X6DS9|0z=zo%FH)q-*~3 zgCkFR3;k16h%?NaSo-VHqem+7GnPNcVI091$ih(^!*QJ0IO1KCS$2>W%~gH7nnam- zx`R=AwnyXw@6s~CywJIxgf}V*p{Cm^=xdiR5~9CZh<25PsLynKWg%LzYA;ju$vr*j zFN7c4U8*6(GS-g|6rwZJ^5jFZsK``(@|f0qVnsDleqSuaCidL$nqIKxWKfbKmng8# zUBn}SES9R$jw7p&nvQ3Bgd?kuF>Ss`{^3>8X%tvrsh_}1!qkg=OOe<=TwjxWs5gGK%!HZPh+MdkJBGNr+Qsxv_OS=dsy(2F77&09p&U zbiY@}U!t;9qtHG^dP;p-23he(2}s+QG< zN?YLV@8jK2h(4|bFIvmWmEHv!8(Za`8Yh!G{qeFapZ|^e#yLJt)(`gdWx2=a`QlHm z-u#@Uleti6XmGvo@X(Mdc9XBHP@sa`QlLf=BhlV3j^uhW+E&KmP79R<3sy2V2-P>J z@3}#k>|L;mu|b%=K?BbX8p?MHMi?73)HewA+#p<*EmX%iUbyU7sFJbJNM;lYFm`RE z@7mB~*RWuDxKK^^)-3#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autofilter-selection-display.php new file mode 100644 index 00000000..1b26cbb5 --- /dev/null +++ b/Examples/10autofilter-selection-display.php @@ -0,0 +1,198 @@ +'); + +/** Include PHPExcel */ +require_once '../Classes/PHPExcel.php'; + + +// Create new PHPExcel object +echo date('H:i:s').' Create new PHPExcel object'.EOL; +$objPHPExcel = new PHPExcel(); + +// Set document properties +echo date('H:i:s').' Set document properties'.EOL; +$objPHPExcel->getProperties()->setCreator('Maarten Balliauw') + ->setLastModifiedBy('Maarten Balliauw') + ->setTitle('PHPExcel Test Document') + ->setSubject('PHPExcel Test Document') + ->setDescription('Test document for PHPExcel, generated using PHP classes.') + ->setKeywords('office PHPExcel php') + ->setCategory('Test result file'); + +// Create the worksheet +echo date('H:i:s').' Add data'.EOL; +$objPHPExcel->setActiveSheetIndex(0); +$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Financial Year') + ->setCellValue('B1', 'Financial Period') + ->setCellValue('C1', 'Country') + ->setCellValue('D1', 'Date') + ->setCellValue('E1', 'Sales Value') + ->setCellValue('F1', 'Expenditure') + ; +$startYear = $endYear = $currentYear = date('Y'); +$startYear--; +$endYear++; + +$years = range($startYear,$endYear); +$periods = range(1,12); +$countries = array( 'United States', 'UK', 'France', 'Germany', + 'Italy', 'Spain', 'Portugal', 'Japan' + ); + +$row = 2; +foreach($years as $year) { + foreach($periods as $period) { + foreach($countries as $country) { + $endDays = date('t',mktime(0,0,0,$period,1,$year)); + for($i = 1; $i <= $endDays; ++$i) { + $eDate = PHPExcel_Shared_Date::FormattedPHPToExcel( + $year, + $period, + $i + ); + $value = rand(500,1000) * (1 + rand(-0.25,+0.25)); + $salesValue = $invoiceValue = NULL; + $incomeOrExpenditure = rand(-1,1); + if ($incomeOrExpenditure == -1) { + $expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25)); + $income = NULL; + } elseif ($incomeOrExpenditure == 1) { + $expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25)); + $income = rand(500,1000) * (1 + rand(-0.25,+0.25));; + } else { + $expenditure = NULL; + $income = rand(500,1000) * (1 + rand(-0.25,+0.25));; + } + $dataArray = array( $year, + $period, + $country, + $eDate, + $income, + $expenditure, + ); + $objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++); + } + } + } +} +$row--; + + +// Set styling +echo date('H:i:s').' Set styling'.EOL; +$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true); +$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(TRUE); +$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(12.5); +$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10.5); +$objPHPExcel->getActiveSheet()->getStyle('D2:D'.$row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2); +$objPHPExcel->getActiveSheet()->getStyle('E2:F'.$row)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); +$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(14); +$objPHPExcel->getActiveSheet()->freezePane('A2'); + + + +// Set autofilter range +echo date('H:i:s').' Set autofilter range'.EOL; +// Always include the complete filter range! +// Excel does support setting only the caption +// row, but that's not a best practise... +$objPHPExcel->getActiveSheet()->setAutoFilter($objPHPExcel->getActiveSheet()->calculateWorksheetDimension()); + +// Set active filters +$autoFilter = $objPHPExcel->getActiveSheet()->getAutoFilter(); +echo date('H:i:s').' Set active filters'.EOL; +// Filter the Country column on a filter value of countries beginning with the letter U (or Japan) +// We use * as a wildcard, so specify as U* and using a wildcard requires customFilter +$autoFilter->getColumn('C') + ->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) + ->createRule() + ->setRule( + PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + 'u*' + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); +$autoFilter->getColumn('C') + ->createRule() + ->setRule( + PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + 'japan' + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); +// Filter the Date column on a filter value of the first day of every period of the current year +// We us a dateGroup ruletype for this, although it is still a standard filter +foreach($periods as $period) { + $endDate = date('t',mktime(0,0,0,$period,1,$currentYear)); + + $autoFilter->getColumn('D') + ->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) + ->createRule() + ->setRule( + PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + array( + 'year' => $currentYear, + 'month' => $period, + 'day' => $endDate + ) + ) + ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP); +} +// Display only sales values that are blank +// Standard filter, operator equals, and value of NULL +$autoFilter->getColumn('E') + ->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) + ->createRule() + ->setRule( + PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + '' + ); + +// Execute filtering +echo date('H:i:s').' Execute filtering'.EOL; +$autoFilter->showHideRows(); + +// Set active sheet index to the first sheet, so Excel opens this as the first sheet +$objPHPExcel->setActiveSheetIndex(0); + + +// Display Results of filtering +echo date('H:i:s').' Display filtered rows'.EOL; +foreach ($objPHPExcel->getActiveSheet()->getRowIterator() as $row) { + if ($objPHPExcel->getActiveSheet()->getRowDimension($row->getRowIndex())->getVisible()) { + echo ' Row number - ' , $row->getRowIndex() , ' '; + echo $objPHPExcel->getActiveSheet()->getCell('C'.$row->getRowIndex())->getValue(), ' '; + echo $objPHPExcel->getActiveSheet()->getCell('D'.$row->getRowIndex())->getFormattedValue(), ' '; + echo EOL; + } +}