| 
 | 
  m vipindas - 2012-01-18 12:35:50  
i need to generate an excel report based on the data from database between a date span. the excel file is generated successfuly. 
  
but now i need to give an heading to the file, so need to merge the cells, can anybody tell me is it possible using this package. 
 
thanks 
 
  
  Joao Rolim - 2012-04-10 18:50:38 -  In reply to message 1 from m vipindas 
I created a new function in the class, which takes as parameters the array and the number of merged cells. 
 
#-------------- 
 
	function writeLineMerge($line_arr, $merge){ 
       if($this->state!="OPENED"){ 
          $this->error="Error : Please open the file."; 
            return false; 
       } 
        if(!is_array($line_arr)){ 
           $this->error="Error : Argument is not valid. Supply an valid Array."; 
            return false; 
        } 
        fwrite($this->fp,"<tr>"); 
        foreach($line_arr as $col) 
           fwrite($this->fp,"<td class=xl24 width=64 colspan=$merge>$col</td>"); 
        fwrite($this->fp,"</tr>"); 
    } 
#-------------- 
It's work! 
  
  Chad Beninati - 2012-05-17 19:12:21 -  In reply to message 2 from Joao Rolim 
Try this out to keep CSS support while merging cells: 
 
		function writeLineMerge($line_arr, $merge, $css = NULL){ 
			if($this->state != "OPENED"){ 
				$this->error="Error : Please open the file."; 
				return false; 
			} 
			if(!is_array($line_arr)){ 
				$this->error = "Error : Argument is not valid. Supply an valid Array."; 
				return false; 
			} 
			if($css!=NULL) 
			{ 
				$cssStr = $this->getCssString($css); 
			} 
						 
			fwrite($this->fp,"<tr>"); 
			foreach($line_arr as $col) 
				fwrite($this->fp,"<td class=xl24 width=64 colspan=$merge $cssStr>$col</td>"); 
			fwrite($this->fp,"</tr>"); 
		}	 
  
   |