#19 Patch, Excel files generated by Crystal

open
nobody
None
5
2007-11-30
2007-11-30
Jenkky
No

The Reader cannot read Excel files generated by Crystal Reports. The reason is that the Reader searches for the text string "workbook" in the file, even though in the Excel the "workbook" string is with CAPS. So add this to oleread.inc:

CHANGE THIS LINE:
if (($name == "Workbook") || ($name == "Book")) {

TO:

if (($name == "Workbook") || ($name == "Book") || ($name == "WORKBOOK")) {

But then, the Reader fetches only numbers and dates..So you need to change the encoding in read.php:

$data->setOutputEncoding("GB2312");
$data->setUTFEncoder('mb');

Even though Mozilla cannot show scandinavian characters (Å, Ä, Ö are shown as ?Å, ?Ä, ?Ö), this worked quite well for me, but you may need to change the encoding to something else. If someone has a solution for the Mozilla problem, please tell me.

Discussion

  • Jenkky
    Jenkky
    2007-11-30

    • summary: Excel files generated by Crystal --> Patch, Excel files generated by Crystal
     
  • Jenkky
    Jenkky
    2007-12-05

    Logged In: YES
    user_id=1943177
    Originator: YES

    Update:
    To read Scandinavian characters and fix the bug for Mozilla described above, use
    $data->setOutputEncoding('ISO-8859-1');
    instead of the OutputEncoding above.

    If you still can't read the Crystal file, add this line to oleread.inc:
    if ($name == "Root Entry" || $name == "ROOT ENTRY") {
    instead of
    if ($name == "Root Entry") {

    //Jenkky