/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
phpoffice
/
phpspreadsheet
/
samples
/
Basic
/
/var/www/vhosts/nabawater/vendor/phpoffice/phpspreadsheet/samples/Basic
mkdir
upload
Name
Size
Mode
Actions
data/
-
0755
rm
01_Simple.php
1839
0644
edit
dl
rm
01_Simple_download_ods.php
2123
0644
edit
dl
rm
01_Simple_download_pdf.php
1758
0644
edit
dl
rm
01_Simple_download_xls.php
2101
0644
edit
dl
rm
01_Simple_download_xlsx.php
2144
0644
edit
dl
rm
02_Types.php
4937
0644
edit
dl
rm
03_Formulas.php
3328
0644
edit
dl
rm
04_Printing.php
2281
0644
edit
dl
rm
05_Feature_demo.php
164
0644
edit
dl
rm
06_Largescale.php
164
0644
edit
dl
rm
07_Reader.php
539
0644
edit
dl
rm
08_Conditional_formatting.php
4976
0644
edit
dl
rm
08_Conditional_formatting_2.php
2541
0644
edit
dl
rm
09_Pagebreaks.php
2257
0644
edit
dl
rm
11_Documentsecurity.php
1851
0644
edit
dl
rm
12_CellProtection.php
1503
0644
edit
dl
rm
13_Calculation.php
6742
0644
edit
dl
rm
13_CalculationCyclicFormulae.php
1075
0644
edit
dl
rm
14_Xls.php
380
0644
edit
dl
rm
15_Datavalidation.php
3360
0644
edit
dl
rm
16_Csv.php
1140
0644
edit
dl
rm
17_Html.php
382
0644
edit
dl
rm
18_Extendedcalculation.php
2947
0644
edit
dl
rm
19_Namedrange.php
2624
0644
edit
dl
rm
20_Read_Excel2003XML.php
323
0644
edit
dl
rm
20_Read_Gnumeric.php
329
0644
edit
dl
rm
20_Read_Ods.php
317
0644
edit
dl
rm
20_Read_Sylk.php
315
0644
edit
dl
rm
20_Read_Xls.php
599
0644
edit
dl
rm
22_Heavily_formatted.php
1475
0644
edit
dl
rm
23_Sharedstyles.php
1828
0644
edit
dl
rm
24_Readfilter.php
1145
0644
edit
dl
rm
25_In_memory_image.php
1481
0644
edit
dl
rm
26_Utf8.php
1400
0644
edit
dl
rm
27_Images_Xls.php
322
0644
edit
dl
rm
28_Iterator.php
1225
0644
edit
dl
rm
29_Advanced_value_binder.php
4668
0644
edit
dl
rm
30_Template.php
1242
0644
edit
dl
rm
31_Document_properties_write.php
3088
0644
edit
dl
rm
31_Document_properties_write_xls.php
3077
0644
edit
dl
rm
37_Page_layout_view.php
1021
0644
edit
dl
rm
38_Clone_worksheet.php
1837
0644
edit
dl
rm
39_Dropdown.php
4033
0644
edit
dl
rm
40_Duplicate_style.php
996
0644
edit
dl
rm
41_Password.php
374
0644
edit
dl
rm
42_RichText.php
2680
0644
edit
dl
rm
43_Merge_workbooks.php
829
0644
edit
dl
rm
44_Worksheet_info.php
734
0644
edit
dl
rm
45_Quadratic_equation_solver.php
2008
0644
edit
dl
rm
46_ReadHtml.php
405
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/phpoffice/phpspreadsheet/samples/Basic/03_Formulas.php
(3328B)
<?php use PhpOffice\PhpSpreadsheet\Spreadsheet; require __DIR__ . '/../Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); $spreadsheet = new Spreadsheet(); // Set document properties $helper->log('Set document properties'); $spreadsheet->getProperties()->setCreator('Maarten Balliauw') ->setLastModifiedBy('Maarten Balliauw') ->setTitle('Office 2007 XLSX Test Document') ->setSubject('Office 2007 XLSX Test Document') ->setDescription('Test document for Office 2007 XLSX, generated using PHP classes.') ->setKeywords('office 2007 openxml php') ->setCategory('Test result file'); // Add some data, we will use some formulas here $helper->log('Add some data'); $spreadsheet->getActiveSheet() ->setCellValue('A5', 'Sum:'); $spreadsheet->getActiveSheet()->setCellValue('B1', 'Range #1') ->setCellValue('B2', 3) ->setCellValue('B3', 7) ->setCellValue('B4', 13) ->setCellValue('B5', '=SUM(B2:B4)'); $helper->log('Sum of Range #1 is ' . $spreadsheet->getActiveSheet()->getCell('B5')->getCalculatedValue()); $spreadsheet->getActiveSheet()->setCellValue('C1', 'Range #2') ->setCellValue('C2', 5) ->setCellValue('C3', 11) ->setCellValue('C4', 17) ->setCellValue('C5', '=SUM(C2:C4)'); $helper->log('Sum of Range #2 is ' . $spreadsheet->getActiveSheet()->getCell('C5')->getCalculatedValue()); $spreadsheet->getActiveSheet() ->setCellValue('A7', 'Total of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B7', '=SUM(B5:C5)'); $helper->log('Sum of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B7')->getCalculatedValue()); $spreadsheet->getActiveSheet() ->setCellValue('A8', 'Minimum of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B8', '=MIN(B2:C4)'); $helper->log('Minimum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B8')->getCalculatedValue()); $spreadsheet->getActiveSheet() ->setCellValue('A9', 'Maximum of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B9', '=MAX(B2:C4)'); $helper->log('Maximum value in either Range is ' . $spreadsheet->getActiveSheet()->getCell('B9')->getCalculatedValue()); $spreadsheet->getActiveSheet() ->setCellValue('A10', 'Average of both ranges:'); $spreadsheet->getActiveSheet() ->setCellValue('B10', '=AVERAGE(B2:C4)'); $helper->log('Average value of both Ranges is ' . $spreadsheet->getActiveSheet()->getCell('B10')->getCalculatedValue()); $spreadsheet->getActiveSheet() ->getColumnDimension('A') ->setAutoSize(true); // Rename worksheet $helper->log('Rename worksheet'); $spreadsheet->getActiveSheet() ->setTitle('Formulas'); // // If we set Pre Calculated Formulas to true then PhpSpreadsheet will calculate all formulae in the // workbook before saving. This adds time and memory overhead, and can cause some problems with formulae // using functions or features (such as array formulae) that aren't yet supported by the calculation engine // If the value is false (the default) for the Xlsx Writer, then MS Excel (or the application used to // open the file) will need to recalculate values itself to guarantee that the correct results are available. // //$writer->setPreCalculateFormulas(true); // Save $helper->write($spreadsheet, __FILE__);
Save
cmd:
run