Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/03/2011, 23:00
Sofmundi
 
Fecha de Ingreso: enero-2010
Mensajes: 302
Antigüedad: 14 años, 3 meses
Puntos: 3
Acentos con PHP y HTML al exportar Archivo a Excel

Tengo el siguiente codigo

Código PHP:
<?php
header
('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=Listado de Activos.xls");
header("Pragma: no-cache");
header("Expires: 0");
include 
"../../Connections/Activos3.php";
$query "SELECT * FROM activo ORDER BY serialemp";
$result mysql_query($query) or die(mysql_error());
$row mysql_fetch_array($result);
$query2 "SELECT SUM(precio) AS total FROM activo";
$result2 mysql_query($query2) or die(mysql_error());
$valores mysql_fetch_array($result2);
echo 
"<table border=1>\n";
echo 
"<tr>\n";
echo 
"<th>CODIGO</th>\n";
echo 
"<th>SERIAL</th>\n";
echo 
"<th>DESCRIPCIÓN</th>\n";
echo 
"<th>PROVEEDOR</th>\n";
echo 
"<th>UBICACIÓN</th>\n";
echo 
"<th>AREA</th>\n";
echo 
"<th>CANTIDAD</th>\n";
echo 
"<th>PRECIO</th>\n";
echo 
"<th>ESTADO</th>\n";
echo 
"<th>CI DEL RESPONSABLE</th>\n";
echo 
"<th>NOMBRE DEL RESPONSABLE</th>\n";
echo 
"<th>CI DEL USUARIO</th>\n";
echo 
"<th>NOMBRE DEL USUARIO</th>\n";
echo 
"<th>FECHA ADQUISICIÓN</th>\n";
echo 
"<th>FECHA VENCIMIENTO GARANTIA</th>\n";
echo 
"<th>COMENTARIO(S)</th>\n";
echo 
"<th>VALOR TOTAL</th>\n";
echo 
"</tr>\n";
$i 0;
do {
echo 
"<tr align=>\n";
echo 
"<td><div align=\"left\">".$row['serialemp']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['serial']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['descripcion']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['proveedor']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['ubicacion']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['area']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['cantidad']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['precio']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['estado']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['ci_responsable']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['nombre_responsable']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['ci_usuario']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['nombre_usuario']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['fecha_adq']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['fecha_gar']."</div></td>\n";
echo 
"<td><div align=\"left\">".$row['comentario']."</div></td>\n";
$i=$i+1;
} while (
$row mysql_fetch_assoc($result)); 
echo 
"<td><div align=\"left\">".$valores["total"]."</div></td>\n";
echo 
"</tr>\n";
echo 
"</table>\n";
mysql_free_result($result);
mysql_free_result($result2);
?>
Me exporta muy bien pero en la parte de tildes y ñ o Ñ no me salen y en la base de datos estan bien se ven, pero no se muestran al exportar a excel alguna solucion ?