-
Notifications
You must be signed in to change notification settings - Fork 65
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
Simple Example in a Controller #14
Comments
Hello simple example on how I used this: class ImportsController extends AppController {
} Plus: yes. You can simply exchange that for the latest version. |
Excellent. |
results in "Call to a member function createWorksheet() on a non-object" but even "PhpExcel" results in the same error. what did i do wrong? |
Just a quick guess: a typo. It should be public $components = array('PhpExcel.PhpExcel'); and you have there public $components = array('PhpExcel.PHPExcel'); |
results in "Call to a member function createWorksheet() on a non-object" |
btw: i'm using cake 2.5.4 |
Hi. I think you forgot to load a worksheet. Check my example code, it starts with |
I'm not trying to load a file, i'm trying to write some. |
yeah. got it. sorry. one more thing. you mentioned updating PHPExcel library. Please try to check in the createWorksheet method of the component, if you var_dump $this->_xls after call |
@michapixel
CakePlugin::load('PhpExcel');
class MyController extends AppController {
// load the PhpExcel component - case is important
public $components = array('PhpExcel.PhpExcel');
/**
* Open an Excel file
*/
function openexcel() {
$fileName = './uploads/sample.csv';
$objPhpExcel = $this->PhpExcel->loadWorksheet($fileName);
// debug
var_dump($objPhpExcel);
}
}
|
Can you please giva a simple Example on how to use this let's say in another Controller?
That'd be nice.
Plus: can we simply exchange the PHPExcel Class with the latest one?
The text was updated successfully, but these errors were encountered: