msantyx / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

How do i select a sheet within a work book? #41

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi 
I am very new to this so please any1 that can help it would be much
appreciated.

I have been looking for ages now for a reader i found this google one which
works but i have a xls file workbook with multiple sheets. Im trying to
modify this code to get it to look between the sheets if that makes sense?

Please note the below works!! just need help on how to make it do what i
need it to. I would like to be able to get it to cross search/read the
workbook (sheets).

Any help would be much appreiciated

I have attached all 3 files.

example.php
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("book1.xls");

?>
<html>
<head>
<style>
table.excel {
    border-style:ridge;
    border-width:1;
    border-collapse:collapse;
    font-family:sans-serif;
    font-size:12px;
}
table.excel thead th, table.excel tbody th {
    background:#CCCCCC;
    border-style:ridge;
    border-width:1;
    text-align: center;
    vertical-align:bottom;
}
table.excel tbody th {
    text-align:center;
    width:20px;
}
table.excel tbody td {
    vertical-align:bottom;
}
table.excel tbody td {
    padding: 0 3px;
    border: 1px solid #EEEEEE;
}
</style>
</head>

<body>
<?php
echo $data->dump(true,true); 

?>
</body>
</html>

Original issue reported on code.google.com by yor...@gmail.com on 8 Aug 2009 at 8:22

Attachments:

GoogleCodeExporter commented 8 years ago

Hi, if you want to dump/read a specific sheet, you need to pass an additional 
parameter to the dump. Here is an example :

for ($SheetNum = 0; $SheetNum < count($data->boundsheets); $SheetNum++)
  {
  $SheetName = $data->boundsheets[$SheetNum]['name'];
  echo "<p style='font-family:Verdana; font-size:24px; font-weight:bold;'>".
    "Sheet # : ". $SheetNum. " - Sheet name : ". $SheetName. "</p>";
  echo $data->dump(true,true, $SheetNum);
  }

bye

Original comment by vve...@hotmail.it on 10 Aug 2009 at 10:39

GoogleCodeExporter commented 8 years ago
Hi, can anyone give any suggestions as to how to get the location of a row or 
column?

Original comment by shadrack...@meltwater.org on 5 Sep 2011 at 2:49

GoogleCodeExporter commented 8 years ago
Shadrack, depends what you want to do with it. Read it? You need to already 
know its coordinates.

Original comment by endar...@gmail.com on 10 Sep 2011 at 9:13