PHP Classes

Created XLS but unable to write to the XLS .Just opening blank

Recommend this page to a friend!

      Excel Writer  >  All threads  >  Created XLS but unable to write to...  >  (Un) Subscribe thread alerts  
Subject:Created XLS but unable to write to...
Summary:XLS opening blank , don't know eaxct problem
Messages:1
Author:venkateshmallina
Date:2011-02-16 13:15:10
 

 


  1. Created XLS but unable to write to...   Reply   Report abuse  
Picture of venkateshmallina venkateshmallina - 2011-02-16 13:15:10
When the below code is exceuted , the XLS should be created with first row ("idPReq","Title","Created Date","HoFinance OK Date") but the values in the array doesnot get wrriten into the XLS
--------------------------------------------------------
include("lib/excelwriter.inc.php");
/* Report Generation for Pending Purchase Requests STARTS*/
$csvDir = $abspath. DIRECTORY_SEPARATOR . 'temp'. DIRECTORY_SEPARATOR . 'kpiexcel';
$dateRand = date('Ymd_His_') . rand(1, 100);
$csvprName = 'results_preqs_' . $dateRand . '.xls';
$excel = new ExcelWriter($csvDir . DIRECTORY_SEPARATOR . $csvprName);
if($excel==false)
echo $excel->error;
$myArr=array("idPReq","Title","Created Date","HoFinance OK Date");
if(isset($_GET['ttc']) && $_GET['ttc'] == 'yes'){
array_push($myArr,"Procurement OK Date","TTC in DAYS(Time To Closure)");
}
$excel->writeLine($myArr);
exit();