简体   繁体   中英

php-excel-reader get cell comments

I'm using:

http://code.google.com/p/php-excel-reader/

And I was wondering if it was possible, to get the cell comments? The documentation seems fairly limited. Does anyone have any idea if it is implemented, or how to modify the class to implement it?

Any help would be appreciated. Thanks.

php-excel-reader doesn't read cell comments... comments are stored in the SPREADSHEET_EXCEL_READER_TYPE_NOTE block, but the reader simply skips these blocks.

If you want to modify php-excel-reader to read cell annotations such as notes, you'll need to create a reader block to handle that option in the switch block of the worksheet substream. Take a look at how PHPExcel reads cell comments to see what the logic should be (the code is in the /Classes/PHPExcel/Reader/Excel5.php file in the _readNote() method), or switch to a Excel library that can actually read cell annotations anyway.

Look at these post not be able to read cell comment

it basically says you can get you're comments easily. with getComments() to get the all or getComment('A1') to get a single one.

$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("first.xlsx");
$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
objWorksheet->getComment('A2');
objWorksheet->getComments();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM