Help me please problem with excel

Help me please problem with excel

by Cornelius Bennett -
Number of replies: 9
OK I am using moodle with some success I can create a course add teachers and users I can do everything and I am very happy EXCEPTsad whenever I try to export the results of a quiz into excel format I get the following error: 

<br/>

<b>Fatal error</b>:  Cannot instantiate non-existent class:  format in <b>c:\programme\easyphp1-7\www\moodle\lib\excel\Workbook.php</b> on line <b>67</b><br/>

I really need an answer to this problem.  does it have something to do with my configuration maybe I just not smart enough to figure this out,  whatever the case may be I need help  I have missed the first deadline to have this software operational  and it could cost me my head if I miss the next one I have posted twice already but no answers me  I am using windows 2000professional service pack 4

Average of ratings: -
In reply to Cornelius Bennett

Re: Help me please problem with excel

by Robert Lefebvre -
Two things.


Do you have the right path to your Excel.exe file entered in the input box. It should be set to Excel.exe in the drop down.  I'm using the 2002 version and it works fine.

Have you tried downloading it as a text file?  Can you open that text file with wordpad? With Excel ( click "Data" in Excel upper nav, choose "Import external data", choose "import data", and run the wizard .


Average of ratings: Useful (1)
In reply to Cornelius Bennett

Re: Help me please problem with excel

by Timothy Takemoto -

When you say you are exporting the results of a quiz is that from the main grades page (with all the grades of all the activities on your course)? Or rather, from the quiz page, are you clicking on the quiz > view reports for x attempts > simple statistics > download in excel format? Eitherway I have no problem in downloading an excel file.


Sorry, I am not adding anything useful. But I would like to know what the problem is.
Tim

In reply to Timothy Takemoto

Re: Help me please problem with excel

by Timothy Takemoto -

Searching for "Cannot instantiate non-existent class" seems to be a fairly straight forward php problem, line 67 in Workbook.php is the important one where the new exel workbook is created

 $this->tmp_format        = new Format();

but before one makes an instance of the class format (an excel workbook), one must first ensure that the class itself exists using a "class declaration". I can remember this from my pascal programing dayes. You have to declare variables (or at least classes in php) before you use (an instance of) them. I do not know where the class declaration takes place, but it should take place somewhere.

One of the recommendations (on a CMS help forum) was that the you may be missing a file or your installation corrupted. If the file where the class was declared did not get uploaded you may not be missing it till now.

This declaration should be taking places in one of the files that is "required" by Workbook.php, which are (on lines 35-37:

require_once('Format.php');
require_once('OLEwriter.php');
require_once('BIFFwriter.php'); 

And judging from the name, and looking inside the file, this declaration seems to be taking place inside Format.php.

I tried renaming Format.php in my installation of Moodle and, yes, it does prevent my downloading excel files but alas there is no error message. I just get taken to a blank page. Hmm...it seems unlikely but is there any chance that your copy of Format.php is corrupted, rather than absent?

Format.php should be 637 lines.

I have had my upload process prevent my uploading the whole of Moodle but never in the middle of a file.

Tim

PS I know how it feels to have one's job depending upon Moodle. Since it works for me I should be donating more. Er, half my income? My wife would not approve.

Average of ratings: Useful (1)
In reply to Timothy Takemoto

Re: Help me please problem with excel

by Cornelius Bennett -

Hi Tim,

Thanks for your reply, but all this seems to be correct in my files It is a mystery.  Could it have something to do with the fact that my installation of windows is in german? 

In reply to Cornelius Bennett

Re: Help me please problem with excel

by Timothy Takemoto -

I am using Moodle on Japanese linux (server) and Japanese Windows (client) so I don't think that German should be a problem. I do have some problems with Moodle in Japanese (such as today I foudn that it seems that Moodle's Aiken Quiz importation format may not support two byte characters) but I don't see how that could effect this issue which is about whether a class declaration has been made or not inside your moodles php files.

The code in Workbook.php and Format.php was not written by Martin by rather by someone converting code from Perl from CPAN into php. It sasy the name of the code converter inside the files. You could try contacting him or even CPAN. But the perl people are unlikely to want to help.

Tim

Average of ratings: Useful (1)
In reply to Cornelius Bennett

Re: Help me please problem with excel

by Zbigniew Fiedorowicz -
Sometimes error messages are misleading.  There might be some problem with that particular quiz which triggers this.  What happens when you go to the main class page, click on Grades under the Administration and then click on "Download in Excel Format"?   Also try this in a class without the quiz.

It is also possible that a corrupted German language file could cause mysterious errors like this.  So try temporarily changing your language to English and see if that makes a difference.

Also does "Download in Text Format" work for that quiz?
Average of ratings: Useful (1)
In reply to Zbigniew Fiedorowicz

Re: Help me please problem with excel

by Cornelius Bennett -
Hi it does'nt seem to have a problem with excel anyplace else except when I try to detail a quizz
In reply to Cornelius Bennett

Re: Help me please problem with excel

by Peter Sereinigg -

Hi,

My problems with excel / GERMAN version and quiz produced other error-results,
try this:
check your quizname, eliminate alle spezial chars, this produced my errors ....

Peter