Load Multiple Excel File According To User Name

Topics: Developer Forum
Sep 27, 2013 at 7:15 AM
Hi.....My Self I Am Karthikeyan, I Am New To PHPExcel, I Have One Problem In My Project, I Want To Get The Excel File Detail According To The Username,Can u Help me....
Sep 27, 2013 at 11:40 AM
What details do you want to get? If it comes to the properties in the workbook, $objExcel->GetProperties()) returns a PHPExcel_DocumentProperties object that puts at disposal methods such as getCreator(), getLastModifiedBy(), etc.
Oct 1, 2013 at 9:20 AM
Edited Oct 1, 2013 at 9:21 AM
Hi...Thanks For Your Reply To My Post, See My Problem Is In My Project I Have a 10 User. For Each User They Have a Separate Excel File,According To The Username or User Id I Want Display The Excel Sheet,Can You Give Any Examples For My Project, It Will Useful For me....
Oct 2, 2013 at 6:20 AM
An example from the documentation, showing a reading of data from an Excel file and the display in a table.
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php'; //change path if needed

$objReader = PHPExcel_IOFactory::createReader('Excel2007');

$objPHPExcel = $objReader->load("test.xlsx");
$objWorksheet = $objPHPExcel->getActiveSheet();

$highestRow = $objWorksheet->getHighestRow(); // e.g. 10
$highestColumn = $objWorksheet->getHighestColumn(); // e.g 'F'

$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); // e.g. 5

echo '<table>' . "\n";
for ($row = 1; $row <= $highestRow; ++$row) {
  echo '<tr>' . "\n";

  for ($col = 0; $col <= $highestColumnIndex; ++$col) {
    echo '<td>' . $objWorksheet->getCellByColumnAndRow($col, $row)->getValue() . '</td>' . "\n";

  echo '</tr>' . "\n";
echo '</table>' . "\n";