Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/04/2015, 12:09
Avatar de rachpts
rachpts
 
Fecha de Ingreso: febrero-2012
Mensajes: 117
Antigüedad: 12 años, 1 mes
Puntos: 0
Sonrisa Llenar tabla usando la libreria PHPpowerpoint

hola amigos, hay alguien que me pueda orientar de como llenar una tabla dinamicamente usando la libreria PHPpowerpoint,

la tengo de esta manera pero no me la dibuja :( y la verdad no estoy muy familiarizada con la libreria, posteo mi codigo por si alguien me puede orientar

Código PHP:
function slide2 ($objPHPPowerPoint,$index,$title)
{
    
$currentSlide=createSlide($objPHPPowerPoint,0);
    
$currentSlide $objPHPPowerPoint->getSlide($index);
    
setTitle($currentSlide);
    
    
//sql
        
$sql="exec [RIA].[dbo].[idle] 2,'".$ip."','','11'";
            
$rs=odbc_exec($connection,$sql);
            
$flag=0;
            while(
odbc_fetch_row($rs)){
                
$data[$flag][0]=odbc_result($rs,"nameR");
                
$data[$flag][1]=round(odbc_result($rs,"team"),0);
                
$data[$flag][2]=round(odbc_result($rs,"hours"),0);
            
$flag++;    
            }
            
        
//create for the first table
    
$shape$currentSlide->createTableShape(3);
    
$shape->setHeight(400);
    
$shape->setWidth(600);
    
$shape->setOffsetX(100);
    
$shape->setOffsetY(100);
    
$sizeFont=8;
    
$row $shape->createRow();
    
$row->setHeight(10);
    
$row->getFill()->setFillType(PHPPowerPoint_Style_Fill::FILL_GRADIENT_LINEAR)
                ->
setRotation(90)
                ->
setStartColor(new PHPPowerPoint_Style_Color('FFFFFF'))
                ->
setEndColor(new PHPPowerPoint_Style_Color('FFFFFF'));
    
    
$cell $row->nextCell();
    
    
$cell->setWidth(70);
    
$cell->createTextRun("Name")->getFont()->setBold(true)->setSize($sizeFont);
    
$cell $row->nextCell();
    
$cell->setWidth(85);
    
$cell->createTextRun("Team")->getFont()->setBold(true)->setSize($sizeFont);
    
$cell $row->nextCell();
    
$cell->setWidth(90);
    
$cell->createTextRun("Hours")->getFont()->setBold(true)->setSize($sizeFont);
    

    for(
$i=0;$i<sizeof($data);$i++)
        {
            
$auxSig=$data[$i];
            
$row $shape->createRow();
            
$row->getFill()->setFillType(PHPPowerPoint_Style_Fill::FILL_GRADIENT_LINEAR)
                        ->
setRotation(90)
                        ->
setStartColor(new PHPPowerPoint_Style_Color('FFFFFF'))
                        ->
setEndColor(new PHPPowerPoint_Style_Color('FFFFFF'));
            
$cell $row->nextCell();
            
$cell->createTextRun($data[$auxSig][0])->getFont()->setBold(false)
                    ->
setSize(8);
            
$cell $row->nextCell();
            
$cell->createTextRun($data[$auxSig][1])->getFont()->setBold(false)
                    ->
setSize(8);
            
$cell $row->nextCell();
            
$cell->createTextRun($data[$auxSig][2])->getFont()->setBold(false)
                    ->
setSize(8);
                    
        }