Esempio n. 1
0
 function GroupStart($title, $subseconds = false, $flags = 0)
 {
     $fixed_title = preg_replace('/[^\\w\\d_]+/', '_', $title);
     $val = substr($fixed_title, 0, EXCELHandler::MAX_TITLE_CHARS);
     $this->sheet = $this->xls->addWorksheet($val);
     if ($this->sheet instanceof PEAR_Error) {
         // Handling name collisions
         if (strlen($fixed_title) > EXCELHandler::MAX_TITLE_CHARS) {
             if (isset($this->collisions[$val])) {
                 $this->collisions[$val]++;
             } else {
                 $this->collisions[$val] = 1;
             }
             $val = substr($val, 0, EXCELHandler::MAX_TITLE_CHARS - strlen($this->collisions[$val]) - 1) . "@" . $this->collisions[$val];
             $this->sheet = $this->xls->addWorksheet($val);
             if ($this->sheet instanceof PEAR_Error) {
                 throw new ADEIException(translate("Error encountered while creating Excel sheet (%s). Info: %s", $title, $this->sheet->toString()));
             }
         }
     }
     $this->row = 0;
     parent::GroupStart($title, $subseconds, $flags);
 }
Esempio n. 2
0
 function GroupStart($title, $subseconds = false, $flags = 0)
 {
     switch ($this->type) {
         case self::TYPE_TDMS:
             $this->group_title = $title;
             $this->data = array();
             break;
         case self::TYPE_ARRAY:
             $this->tmpfile = GetTmpFile("adei_stream_excel_", $this->extension);
             $this->hout = new IO($this->tmpfile);
             $this->hout->Open();
             break;
         case self::TYPE_STREAMARRAY:
             $this->hout = $this->h;
             break;
     }
     parent::GroupStart($title, $subseconds, $flags);
 }