Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Apr 21, 2016 · 3 comments
Open

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

GoogleCodeExporter opened this issue Apr 21, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 8 Aug 2009 at 8:22

Attachments:

@GoogleCodeExporter
Copy link
Author


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 [email protected] on 10 Aug 2009 at 10:39

@GoogleCodeExporter
Copy link
Author

Hi, can anyone give any suggestions as to how to get the location of a row or 
column?

Original comment by [email protected] on 5 Sep 2011 at 2:49

@GoogleCodeExporter
Copy link
Author

Shadrack, depends what you want to do with it. Read it? You need to already 
know its coordinates.

Original comment by [email protected] on 10 Sep 2011 at 9:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant