Visualizzazione dei risultati da 1 a 2 su 2

Discussione: problema excel reader

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446

    problema excel reader

    ciao a tutti, ho trovato navigando qua e la questa libreria. Sono riuscita a crearmi una tabella contenente il mio file xls, solo che il mio file prova.xls è formato da più fogli (per la precisione 3). Con quello che ho scritto, mi legge tutto il primo foglio. Come faccio se volessi leggere il foglio numero 3?

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446
    sono riuscita a farlo funzionare solo che mi sopra alla mia tabella contenente i dati di excel mi compare questo errore:

    Notice: Undefined variable: formatstr in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\fantacalcio\Excel\read er.php on line 410

    Vi metto il codice a cui si riferisce quest'errore:

    codice:
    case Spreadsheet_Excel_Reader_Type_XF:
                            //global $dateFormats, $numberFormats;
                            $indexCode = ord($this->data[$pos+6]) | ord($this->data[$pos+7]) << 8;
                            //echo "\nType.XF ".count($this->formatRecords['xfrecords'])." $indexCode ";
                            if (array_key_exists($indexCode, $this->dateFormats)) {
                                //echo "isdate ".$dateFormats[$indexCode];
                                $this->formatRecords['xfrecords'][] = array(
                                        'type' => 'date',
                                        'format' => $this->dateFormats[$indexCode]
                                        );
                            }elseif (array_key_exists($indexCode, $this->numberFormats)) {
                            //echo "isnumber ".$this->numberFormats[$indexCode];
                                $this->formatRecords['xfrecords'][] = array(
                                        'type' => 'number',
                                        'format' => $this->numberFormats[$indexCode]
                                        );
                            }else{
                                $isdate = FALSE;
                                if ($indexCode > 0){
                                	if (isset($this->formatRecords[$indexCode]))
                                    	$formatstr = $this->formatRecords[$indexCode];
                                    //echo '.other.';
                                    //echo "\ndate-time=$formatstr=\n";
                                    if ($formatstr)
                                    if (preg_match("/[^hmsday\/\-:\s]/i", $formatstr) == 0) { // found day and time format ******è questa la riga 410
                                        $isdate = TRUE;
                                        $formatstr = str_replace('mm', 'i', $formatstr);
                                        $formatstr = str_replace('h', 'H', $formatstr);
                                        //echo "\ndate-time $formatstr \n";
                                    }
                                }
    
                                if ($isdate){
                                    $this->formatRecords['xfrecords'][] = array(
                                            'type' => 'date',
                                            'format' => $formatstr,
                                            );
                                }else{
                                    $this->formatRecords['xfrecords'][] = array(
                                            'type' => 'other',
                                            'format' => '',
                                            'code' => $indexCode
                                            );
                                }
                            }
                            //echo "\n";
                        break;

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.