2011-12-10

PHP-EXCEL part 3 Read your excel

Now we will read your excel. In my example I will use XLS dan XLSX..
Actualy the code will be the same. This code will be the base for next part. Uploading part. My step for next part

  1. Take a wallet;
  2. search for Nasgor restaurant;
  3. buy a nice Nasgor???
Ups... wrong step!!
  1. upload the excel. Not submit yet;
  2. choose how many rows this excel have. I don't know how to take max rows&column in the excel file;
  3. submit;
  4. process;
  5. show on the next page.. what inside the excel;

This is the code.. If you can't read or want to copy.. go to here
the code contain open Object and load.. then read it using GetCell and getValue;

in getCell you must describe what inside Cell (ex: B1). This script will be hard if you don't know how many and what cell contain with value. Or perhaps you will take a blank ? This code will be usefull if we can combine with last part (type and make excel)

but I read their is problem for data that created by this script can't be open?! but I try using my previous code. the work able to open it then editing. Last save the file. And then if the software contain password or security. this script can't read them.

 the main issue in here.. There isn't any close !? like this

$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
the code are important. When you stop the code/script still open while you should end this. The code perhaps trouble your server or worst if you not end like above...


For Full code here
Source: Original.

Tidak ada komentar: