PhpSpreadsheet icon indicating copy to clipboard operation
PhpSpreadsheet copied to clipboard

Feature request: functionality to detect and read sheet tables and related styles

Open bokrma opened this issue 1 year ago • 5 comments

in order to fully use the repo. there should be away to detect and read the sheet tables and styles, specially when importing the files, because currently all sheets with tables are broken because of no table functionality exists

bokrma avatar May 08 '24 09:05 bokrma

Much table functionality has been added. If you find that it isn't working properly, please open a new issue so that we can take a look at it.

oleibman avatar May 08 '24 14:05 oleibman

the issue is that when I import an Excel file that has table from Google or excel sheet, it doesn't identify those tables and cant detect them please let me know how to detect them, and handle them on the importing functionality

bokrma avatar May 14 '24 08:05 bokrma

If you have a sample spreadsheet and code that demonstrates your problem, please upload it. Without that, there is nothing that I can do to help.

oleibman avatar May 14 '24 13:05 oleibman

$this->worksheet->getTableNames(), and $this->worksheet->getTableCollection() not getting anything from this example sheet and I cant identify the tables inside the sheet in any way invoice (2).xlsx

Screenshot 2024-05-16 at 14 17 07

bokrma avatar May 16 '24 12:05 bokrma

Thank you for the spreadsheet. I am unable to duplicate your problem.

$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('issue.4020.xlsx');
$worksheet = $spreadsheet->getActiveSheet();
var_dump($worksheet->getTableNames());

Output:

C:\git\issue.4020.php:12:
array(1) {
  [0] =>
  string(7) "Table_1"
}

What release of PhpSpreadsheet, and what release of Php, are you using? What else can you tell me about your environment?

oleibman avatar May 16 '24 14:05 oleibman

oh i think there was problem with the version, thanks now I can get the names of the tables

bokrma avatar May 24 '24 15:05 bokrma