|
#1
|
|||
|
|||
|
Hello!
I am a PHP developer. I have to use Excel_Spreadsheet_Writer module in my website. I have working copy of the website on my local computer, but when I'm trying to upload it on hosting I see next error: Fatal error: Class 'Spreadsheet_Excel_Writer' not found in /home/... As I understand, I need to include line like "require_once "path_to_the_Writer.php"" in my PHP script. Can anyone from support tell me this path? Can any other developer tell me it? Thanks. |
|
#2
|
||||
|
||||
|
If you are using "require_once" and it is failing, your path is wrong.
The path works the say way as it works for images. (provided that the script is below /public_html/ |
|
#3
|
|||
|
|||
|
Quote:
Quote:
Does anybody know this path? |
|
#4
|
||||
|
||||
|
Sorry, I misunderstood. I thought you were asking who to include PHP into PHP. If you want to include Perl modules into PHP, its fairly simple. You can't.
|
|
#5
|
|||
|
|||
|
Quote:
I don't need the Perl. Excel_Spreadsheet_Writer is the PHP module. I just need to know path to it on the server. I need to use this path in the "require_once" . |
|
#6
|
||||
|
||||
|
Post exactly the require once line you used.
|
|
#7
|
|||
|
|||
|
I have found correct path to the module. Finally, working line is:
require_once "Spreadsheet/Excel/Writer.php"; Thank you for your help. |
|
#8
|
|||
|
|||
|
Their is a good tutorial here:
http://pear.php.net/manual/en/packag...iter.intro.php require_once 'Spreadsheet/Excel/Writer.php'; Best Regards, ![]() |
|
#9
|
|||
|
|||
|
Quote:
In all cases thanks for your help.
|
|
#10
|
||||
|
||||
|
Wow, that is cool!
|
|
#11
|
|||
|
|||
|
I want to have an online spreadsheet, and don't really want to use Googles online spreadsheet setup.
Is that what this is all about doing? I looked at the link chaloupe posted it it doesn't explain (to me at least), what the concept of this spreadsheet writer is all about Thanks, Tom |
|
#12
|
||||
|
||||
|
Ok, some stuff to remember when trying to use this.
1. php.ini override files change your include settings. They must be include_path = ".:/usr/lib/php:/usr/local/lib/php" The PEAR stuff is in the third path listed. 2. PEAR might be installed, items might be listed in CPANEL, but they may not be installed. Use pear list to see what is installed. In my case, OLE nor Spreadsheets were actually installed. In fact, it looks like almost nothing was installed. I installed OLE and Spreadsheets and it works fine now using the example code above. Basically, this is a PHP module that allows programmers to write to xls files directly from PHP. If you upload the example in a php file, it will create a spreadsheet with the variables listed. I wrote a quick program that dumps a file into a spreadsheet from a database. Last edited by Serra; 12-18-2006 at 08:44 AM. |
|
#13
|
|||
|
|||
|
Yea, that is cool
The code I copied from chaloupes link results in this www.tomowa.net/php_excel Code:
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
// sending HTTP headers
$workbook->send('test.xls');
// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');
// The actual data
$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith');
$worksheet->write(1, 1, 30);
$worksheet->write(2, 0, 'Johann Schmidt');
$worksheet->write(2, 1, 31);
$worksheet->write(3, 0, 'Juan Herrera');
$worksheet->write(3, 1, 32);
// Let's send the file
$workbook->close();
?>
What is the best way to do this? MySQL and PHP? If anybody knows of any tutorials that would get me going in the right direction, it would be appreciated Tom |
|
#14
|
||||
|
||||
|
Quote:
The best use of this software is to take a mySQL database and export it as an excel. For that, it works wonderfully. I really had never done anything with PEAR before. Of course, it would have never worked because I didn't have any of it installed on my server, but now that I know how to install it, I may well use it more often. |
|
#15
|
|||
|
|||
|
Quote:
I'm gonna shelve it then....I can't even find time to get to my exercise bike, which I actually enjoy , let alone tackle learning this
|
|
#16
|
||||
|
||||
|
Quote:
pear install OLE-beta pear install Spreadsheet_Excel_Writer-beta |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 10:13 PM.








The code I copied from chaloupes link results in this




