|
From: Jost B. <jos...@ya...> - 2004-11-16 20:21:16
|
Hi,
I get a "class not found" in 1.0.6 when I try to
access the write.Workbook. Since we want to write a
workbook we need write.WriteableWorkbook.
I don't know why you get a null pointer instead of a
"class not found" exception. Which version of the
bridge and which version of jxl.jar do you use?
I have tested with 1.0.6a and the jxl and code below:
<?php
java_set_library_path("http://www.jspwiki.org/attach?page=ExcelToHTMLPlugin%2Fjxl.jar");
$fname1 = tempnam("/tmp", "demo.xls");
$file = new java("java.io.File", $fname1);
$wbClass=new java("jxl.write.WritableWorkbook");
$workbook=$wbClass->createWorkbook($file);
?>
That worked as well as reading a workbook:
$file = new java("java.io.File", "test.xls");
$wbClass=new java("jxl.Workbook");
$wbClass->getWorkbook($file);
...
$row=$sheet->getRow(1);
$stringClass = new java("java.lang.String");
foreach ($row as $key => $value) {
print $key . " -> ";
print $stringClass->ValueOf($value) . "\n";
}
Jost
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
|