When I try to create an Excel export file I get this error.

Fatal error: Class 'PHPExcel_Writer_' not found in xxx/sites/all/libraries/PHPExcel/Classes/PHPExcel/IOFactory.php on line 141

Any help would be much appreciated. Not too sure what to do.

Comments

infojunkie’s picture

Not sure either what might be wrong, so we'll need to debug:

In the file sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc, please add the following lines after line 74 (which should read $plugin = $plugins[$results['format']]; in function _sheetnode_phpexcel_batch_export_finished:

dsm($plugins);
dsm($plugin);
dsm($results);

Also, comment out the lines that read:

//$writer = PHPExcel_IOFactory::createWriter($workbook, $plugin['php-excel-type']);

and

//$writer->save($tempname);

Finally, enable Devel module.

What's the debugging output that gets printed? You might need to click it to expand the text.

Thanks for your help!

HelloStephanie’s picture

StatusFileSize
new111.69 KB
new67.89 KB
new292.52 KB

Thank you so much for your quick reply. I went ahead and followed your steps for debugging...

First, I get this message from Drupal in the system messages box:

Notice: Undefined index: in _sheetnode_phpexcel_batch_export_finished() (line 74 of xxx/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc).
Notice: Undefined index: in _sheetnode_phpexcel_batch_export_finished() (line 74 of xxx/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc).

I attached 2 screenshots of the messages Devel output on the screen. Devel_output2.jpg had a ton of output code when you expand "workbook" -- so I've gone ahead and attached that as well, in case it's useful to look at.

infojunkie’s picture

The error occurs because the $format variable is empty while it should hold the desired format you chose (e.g. `xls`, `xlsx`, etc.)

* What is the link that you click to export? Please paste its URL here.
* On line 22 of sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc, before the line that reads sheetnode_phpexcel_batch_export($sheets, $node->title, $format);, please add:

dsm($format);

Also remove the other dsm calls you had added previously to avoid cluttering the output. What debugging output do you see now?

HelloStephanie’s picture

StatusFileSize
new27.99 KB

Hmm... not sure if I did this right. Should I have un-commented the things you told me to comment out?

This time I ran it form the url http://www.foo.com/excel/spreadsheet (the URL I created using feed setting for path in views) and it went through with no error from Devel. It did have this error output from Drupal:

Notice: Undefined index: in _sheetnode_phpexcel_export_download() (line 121 of xxx/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc).
Notice: Undefined index: in _sheetnode_phpexcel_batch_export_finished() (line 75 of xxx/sites/all/modules/sheetnode/modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc).

The file that downloaded appears to be an HTML doc of SQL (I've attached it). I had to re-save it as a .pdf to attach here, but it downloaded as a .html file.

infojunkie’s picture

I think I understand now: you're trying to export a view, not a node! Can you confirm this?

If so, in the feed's style options, did you select a file format in the "Export as" setting?

HelloStephanie’s picture

Hi -- sorry for the slow reply. Yes, I see the "Export as" Setting -- I'm not sure how I completely missed this!

I'll let you know if I have anymore troubles.

infojunkie’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

Closing this as a support request for now.

HelloStephanie’s picture

Category: support » bug
Priority: Normal » Critical
Status: Fixed » Active

Ok. Now I'm having a different problem where every file I try to download (xls, xlsx, or pdf) downloads as a blank file despite the fact that there is content in the main page which it is attached to...

infojunkie’s picture

Category: bug » support
Priority: Critical » Normal

Can you please download the latest dev and try again?

Also, let's treat this as a support request until we find a critical bug.

HelloStephanie’s picture

Status: Active » Closed (fixed)

-beta2 fixed all my problems.

Works great! Thank you so much, this module rocks (once I figured out how to enable it properly *facepalm*)

I missed the xls button the first time b/c when I clicked on Format --> Settings under feeds, the window jumped down to the section where you put in a template. Might just be my install though...

infojunkie’s picture

No, the scrolling is a bug. I logged it to remember: #1571336: Page scrolls to spreadsheet upon loading. Thanks!