Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/03/2006, 15:30
Avatar de helthon
helthon
 
Fecha de Ingreso: junio-2005
Ubicación: Lima
Mensajes: 549
Antigüedad: 18 años, 9 meses
Puntos: 7
Mi reporte en excel sale vacio

Hola a todos tengo mi reporte en excel que al princio salia bien (eso recuerdo) pero ahora me sale todos los campos vacios y revisando mi B.D. si hay información.
Aquie mi codigo:

Código PHP:
<?
//EXPORTAR EMPRESAS
$consultaempresa "SELECT id_empresa, razonsocial, ruc, direccion, distrito, telefono, fax, email, website, giro, imagen FROM empresa";

$exportarExcelempresa mysql_query($consultaempresa$dbh) or die (mysql_error()); 

if (
mysql_num_rows($exportarExcelempresa))
{
$shtml="<table width='900' border='1' cellpadding='0' cellspacing='0' bordercolor='#B9B9B9'>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='11'><strong>REPORTE DE EMPRESAS POR ORDEN ALFABETICO </strong></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='11'></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Id</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Razon Social </strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Ruc </strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Direccion</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Distrito</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Telefono</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Fax</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Email</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Web Site</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Giro</strong></td>";
$shtml=$shtml."<td bgcolor='#EEEEEE'><strong>Imagen</strong></td>";
$shtml=$shtml."</tr>";
while(
$row_empresa mysql_fetch_array($exportarExcelempresa)) 
{
$shtml=$shtml."<tr>";
$shtml=$shtml."<td>".$row_empresa['id_empresa']."</td>";
$shtml=$shtml."<td>".$row_empresa['razonsocial']."</td>";
$shtml=$shtml."<td>".$row_empresa['ruc']."</td>";
$shtml=$shtml."<td>".$row_empresa['direccion']."</td>";
$shtml=$shtml."<td>".$row_empresa['distrito']."</td>";
$shtml=$shtml."<td>".$row_empresa['telefono']."</td>";
$shtml=$shtml."<td>".$row_empresa['fax']."</td>";
$shtml=$shtml."<td>".$row_empresa['email']."</td>";
$shtml=$shtml."<td>".$row_empresa['website']."</td>";
$shtml=$shtml."<td>".$row_empresa['giro']."</td>";
$shtml=$shtml."<td>".$row_empresa['imagen']."</td>";
$shtml=$shtml."</tr>";
}
}
$shtml.="</table>";
$scarpeta="excel/";
$enlaceempresa=$scarpeta."relacionempresas.xls"//ruta del archivo a generar 
$fp=fopen($enlaceempresa,"w"); 
fwrite($fp,$shtml); 
fclose($fp); 
?>
__________________
HELTHON FUENTES
FLORERIA FLORES PERU Floresperu.com.pe
Garantizamos que cada entrega de flores será de la más alta calidad y frescura