phpoffice

Open XLSX file that protected by a password with PHPSpreadsheet

戏子无情 提交于 2021-02-19 01:23:46
问题 I'm trying to open an Excel file (.xlsx) that is protected by a password with PHPSpreadsheet (documentation). I know the password but I don't find a way to open it. The load() method of \PhpOffice\PhpSpreadsheet\Reader\Xlsx doesn't give the possibility to insert a password and when I try to load the file it returns an error (of course). use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet =

Open XLSX file that protected by a password with PHPSpreadsheet

白昼怎懂夜的黑 提交于 2021-02-19 01:23:20
问题 I'm trying to open an Excel file (.xlsx) that is protected by a password with PHPSpreadsheet (documentation). I know the password but I don't find a way to open it. The load() method of \PhpOffice\PhpSpreadsheet\Reader\Xlsx doesn't give the possibility to insert a password and when I try to load the file it returns an error (of course). use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet =

How to set range of separate cells in DataSeriesValues PHPExcel RadarChart

北城以北 提交于 2021-02-10 16:24:29
问题 I can't make radar chart with PHPExcel. I need to add to DataSeriesValues range of separate cells $xAxisTickValues = [ new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5', NULL, 1), new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$10', NULL, 1), new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$14', NULL, 1), new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$17', NULL, 1), ]; //This works fine $xAxisTickValues = [ new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!

PHPSpreadsheet and writing large numbers of decimal places

烂漫一生 提交于 2020-08-10 18:05:29
问题 I'm having difficulty with PHPSpreadsheet when creating an XLSX file and attempting to write large numbers of decimal places to numerical values. PHPSpreadsheet is rounding my 14 decimal place numbers, but I need them stored exactly as presented. I'm using setFormatCode('0.00000000000000') as described in the documentation, but it's not working as I would expect. Here's my test code: <?php require __DIR__ . '/vendor/autoload.php'; // Installed via composer $spreadsheet = new \PhpOffice

PHPPresentation lose styling when we copy from particular path and saving new pptx

亡梦爱人 提交于 2020-01-05 10:08:13
问题 I have search around google regarding PHPPresentation but nothing found. I know this type of question already asked (PHPOffice PHPPresentation lose original styling on saving pptx) and i have checked the answer of this particular question (https://github.com/PHPOffice/PHPPresentation/issues/161) I have done according to above answer but its not working at all. Here is my below code:- $templatepath = public_path('images/samples/sample.pptx'); $pptReader = IOFactory::createReader(

PhpSpreadsheet is corrupting files

感情迁移 提交于 2020-01-03 17:51:08
问题 I am using PhpSpreadsheet to modify an existing file and send it to the browser, but every time I download the file excel gives me the following error: We found a problem with some content in filename.xlsx. Do you want us to try and recover as much as we can? If you trust the source of this workbook, click Yes. I have stripped back everything to the following code. The template file that I am opening is a brand new excel file, with no edits made to it (to avoid the potential that the error

PhpSpreadsheet: Permissions | ZipArchive::close(): Failure to create temporary file

人盡茶涼 提交于 2019-12-23 15:14:07
问题 I would like to offer an Excel-File for download with PhpSpreadsheet Here is my code: require 'vendor/autoload.php'; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('A1', 'Hello World !'); $writer = new Xlsx($spreadsheet); $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); header('Content-Type: application/vnd.ms-excel'); header(

PHPWord addTOC is not displaying page numbers

Deadly 提交于 2019-12-20 10:55:50
问题 I'm using https://github.com/PHPOffice/PHPWord to generate a word document. The function addTOC generates an index of pages with titles, but for some reason the page numbers do not display. // add table of contents $section->addTOC(); Results in: If I echo the page numbers on the pages where the titles exist, they display fine. But they don't display in the TOC. I checked to confirm the text isn't white. 回答1: From PHPWord example in samples dir (https://github.com/PHPOffice/PHPWord/blob

PHPOffice PHPPresentation lose original styling on saving pptx

拟墨画扇 提交于 2019-12-12 21:50:05
问题 I have simple code that: Load template pptx (*) Duplicate few slides Hydrate those slides with values (just replacing place-holder texts) Save result to new file Unfortunately PHPOffice's PHPPresentation is unable to retain slide styling present in template. Slides saved in step 4. are all white (default styling). Is there a way to explicitly copy that styling? Is it PHPPresentation limitation 'cause it's unable to read styling or something? (*) Described issue persist for ppt/odp too. No

ZipArchive::close(): Failure to create temporary file: Permission denied nginx

半城伤御伤魂 提交于 2019-12-05 23:31:10
问题 I would love a good suggestion how to fix the following. For a platform I have to create php word documents and it so happens that on the Apache dev environment this code executes perfectly; yet on the nginx platform I keep on receiving the error as the topic suggests: ZipArchive::close(): Failure to create temporary file: Permission denied The build up is pretty simple: $phpWord = new \PhpOffice\PhpWord\PhpWord(); //code block as in the documentation $objWriter = \PhpOffice\PhpWord\IOFactory