Questions tagged [phpspreadsheet]

PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.

See:

859 questions
0
votes
2 answers

How to change the sheet title color background?

Trying to change the background color of the sheet title with PHPSpreadsheet. No success with something like `$sheet ->getTitle($sheet1)->getStyle()->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID);` How would you address…
JDEC
  • 93
  • 8
0
votes
1 answer

Will PHPSpreadsheet convert xls to xlsx and preserve formatting?

I am on the fact-finding part of our project specs and have not found a definitive answer re whether PHPSpreadsheet can convert an .xls to .xlsx and preserve formatting, such as table borders. From this question, I see that there are separate…
crashwap
  • 2,846
  • 3
  • 28
  • 62
0
votes
1 answer

PhpSpreadsheet is turning number cells into decimals while reading

I try to read a spreadsheet however when there is only numbers in a cell, it puts them as .0 digits, ie, if the cell value is 123, it reads it as 123.0 int. Is there a way to read them as raw string? try { $inputFileType =…
senty
  • 12,385
  • 28
  • 130
  • 260
0
votes
2 answers

phpspreadsheet use of the MD5 hashing

This question is for the developers of phpexcel/phpspreadsheet. We are currently using the library on our website to generate excel files (obviously) and are currently in the process of getting SOC2 certified; which requires us to run all our code…
iGuy
  • 42
  • 3
0
votes
1 answer

Can I read and write xslm files with php?

Can I read and write an xlsm file with PHPSpreadsheet i did it with xlsx files. this is my code
0
votes
0 answers

PhpSpreadsheet - How to set a chart 's series option is minor coordinate

I am using PHPSpreadsheet to create a line chart. Is there anywhere that I can set the minor or major coordinates on a series? I have read the documentation and can't find the method. Thanks
0
votes
2 answers

phpspreadsheet can't read Chinese word when read csv file

I am using PhpSpreadsheet to read files (csv, xls, xlsx). But when I reading csv files, the content of Chinese word can't read (it's null). enter image description here This csv file: enter image description here This is my code:
Piao
  • 1
  • 3
0
votes
2 answers

PhpSpreadsheet when using getNumberFormat Object of class could not be converted to string

The value of Cell C13 is: 01/02/2018 and i need to get same result on output but: If using $d_calib = $spreadsheet->setActiveSheetIndex(2)->getCell( 'C13' )->getValue(); the result is: 42010 also if echo $d_calib =…
Mina
  • 31
  • 7
0
votes
1 answer

PhpSpreadsheet force download file not working - bad format

Problem: The created (XLSX) file is send to email and works well but it doesn't not open when I download it using this script, MS Excel shows "invalid file format or extension" error. I wrote a script to force download an excel file from the server…
odedta
  • 2,430
  • 4
  • 24
  • 51
0
votes
1 answer

Is there a replacement for setZipClass in PhpSpreadsheet?

I'm migrating my app from PhpExcel to PhpSpreadsheet. Is there a replacement for setZipClass? I can't find it in the documentation. Below is the line that I'm trying to update. PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);
0
votes
1 answer

Installing Composer and Packagers - first time

I have never used Composer, but I want to use PHPSpreadsheet package, and it is recommended that Composer is used. I am on a MAC using XAMPP and Netbeans. I have installed Composer, and I have run the following command to get and install the…
StripyTiger
  • 877
  • 1
  • 14
  • 31
0
votes
1 answer

How to change a phpspreadsheet-object into a html-object

I'm working with phpspreadsheet. In a part of my code I have to generate a html-object: $writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet); $writer->save($fileNameHTML); $html = file_get_contents($fileNameHTML); I need a function…
Joergeson
  • 1
  • 2
0
votes
1 answer

PhpSpreadSheet : Writing to a specific WorkSheet

I'm new to PhpSpreadSheet, and I'd like to know if there is a way to load a CSV into a specific WorkSheet ? I tried the code bellow but it seems to keep loadind the CSVs into the first WorkSheet :/.
0
votes
1 answer

PHP + MySQL: Upload large spreadsheet into MySQL efficiently

I am using PHPSpreadsheet to take some spreadsheets a user can upload, add a column with certain values, save the file as CSV, and use the following query to import the csv file: LOAD DATA LOCAL INFILE '{$file}' INTO TABLE {$table} FIELDS TERMINATED…
Bijan
  • 7,737
  • 18
  • 89
  • 149
0
votes
2 answers

Set margin for PHP Spreadsheet printing to PDF

I have the following code: $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE); $sheet->getPageMargins() ->setLeft(0.1) ->setRight(0.1) …
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69