Questions tagged [phpoffice]

PHPOffice is an open-source collection of libraries used for reading and writing files in formats compatible with various "office" suites, such as Microsoft Office and OpenOffice.

242 questions
0
votes
0 answers

How to set fontsize for a custom paragraph style created by addParagraphStyle method in phpword in php

I have a custom code written for php to generate word. I want to create new custom paragraph style 'MyStyle' and it needs to be generated like font size '18' and style 'Calibri'. Here is my code as per phpword…
0
votes
0 answers

How to read a .docx file in Laravel?

I have a laravel app, version 5.39. I'm using phpoffice/phpword 0.15 library. I'm trying to upload a .docx file and read its content. I tried this: $phpWord = IOFactory::createReader('Word2007')->load($request->file('file')->path()); $text…
Tom Bom
  • 1,589
  • 4
  • 15
  • 38
0
votes
0 answers

creating a subtable in phpword

i would like to add a subtable to the an already working table in phpword. here is what i have done: $row = $table->addRow(); $cell = $row->addCell(); $subtable_obj = new Table(array('align' => 'center')); $subtable_row =…
composersucks
  • 61
  • 1
  • 6
0
votes
1 answer

Laravel Excel - Formula adding extra @ Symbol, Breaking Formula

I'm working on an Export method in Laravel to generate an XLSX file with included formulae. Everything is working, but on Export, the formula is getting an extra @ symbol added in a couple places, which then breaks the formula... The cell value is…
Tim Lewis
  • 27,813
  • 13
  • 73
  • 102
0
votes
1 answer

How do I replace the placeholder in the footer?

there is a code like this: $templateProcessor = new TemplateProcessor('path to DOCX file.....'); $table = new Table(['unit' => TblWidth::AUTO]); $table->addRow(); $table->addCell(null, [ 'borderTopColor' => 'ff0000', 'borderTopSize' => 1, …
Mister X
  • 11
  • 3
0
votes
0 answers

Add chart to word template with PhpWord

Good day! In PhpWord one can generate a chart with: $chart = $section->addChart('pie', array('A', 'B', 'C', 'D', 'E'), array(1, 3, 2, 5, 4)); I'd like to add that chart to a doc template that uses ${graph} as…
Fabbio
  • 343
  • 2
  • 16
0
votes
1 answer

phpword templateProcessor return value?

What is the return value of $template_processor->saveAs()? , i tried to catch the return value to determine whether the process is successfully executed or not public function create_spm($data_spm){ $templateFile =…
0
votes
0 answers

When loading a file with a table in phpword through IOFactory, the style is broken

I have a file with a table in it. I loaded it use IOFactory and saved it. I reopened the saved file, the table lines were deleted, each content was placed in different places and it was a mess. if style exists in the table, it throws the following…
0
votes
2 answers

How to make dynamic header data export from database to excel using Maatwebsite in Laravel

In my case, i have problem like this Sample table and data : // Table Account Id | Name | 1 | Kiara | 2 | Steve | My currently code is :
rizcrime
  • 3
  • 3
0
votes
0 answers

PHPOffice: PHP Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found

I have custom WordPress plugin where I giving option for admins to download export of survey. The plugin using package phpoffice I have test hosting with PHP 7.3 where export goes well and the production hosting is on PHP 7.3.3 (before it was PHP…
MartyQek
  • 1
  • 1
0
votes
1 answer

When i Try to reverse the Axis with the following code i do not obtain the reverse orientation

When I try to reverse the axis with the following code I do not obtain the reverse orientation $chart1->getChartAxisX()->setAxisOrientation(Axis::ORIENTATION_REVERSED); How to change the coordinate axis from small to large?
robbin wu
  • 3
  • 2
0
votes
0 answers

PhpOffice\PhpSpreadsheet dynamic style

I using PhpOffice\PhpSpreadsheet $spreadsheet = new Spreadsheet(); /* @var $sheet \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet */ And prepare array with all data in another function. Then I put array to PhpSpreadSheet $sheet =…
Nisk
  • 1,084
  • 9
  • 9
0
votes
0 answers

laravel PhpSpreadsheet horizontal axis one category between 2 bars for bar chart

using Laravel Excel to show chart in excel export. I have 2 values target value and achieved value for each category. $labels = [new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Charts!$C$1', null)]; $categories = [new…
0
votes
1 answer

Excel Spreadsheet with Data Filters. PhpSpreadsheet Laravel

I am currently generating an Excel spreadsheet with the result of a Query: if($request->get('excel')){ return Excel::download(new RsestagiosExcel($dados,$campos,$nomeCampos), 'relatorio_estagios.xlsx'); }else{ return…
0
votes
0 answers

Is it possible to set a header to be 100% page width (not constrained by margins)

I am using PHPWord to construct a Word document from scratch. I am using a table in the header to position the three items where I want them, as I struggled managing the layout just placing text blocks. While I've been able to get the header content…
Offbeatmammal
  • 7,970
  • 2
  • 33
  • 52