huesos52
gracias por responder
ya tenía en mente lo de la configuración regional, pero me temía que desde el script de php se podía hacer algo para formatear el excel que se baja cada cliente
aqui te paso el script tal cual me pedistes
Código:
<?php
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=lista_de_precios.xls");
header("Pragma: no-cache");
header("Expires: 0");
mysql_connect("localhost", "xxxxx", "xxxxxx");
mysql_select_db("xxxxxx");
$sql="select codigo, descripcion, precio_lista, categoria from productos2 order by categoria, descripcion asc";
$res=mysql_query($sql);
mysql_close();
$color=orange;
echo "<table border=1>";
echo "<tr><td colspan=4 align='center'><font color='green'><h1><u>xxxxxxx</u><h1></font><br />
<h4>xxxxxxxxx</h4>
<h4>www.xxxxxx.com.ar</h4></td></tr>";
echo "<tr><td colspan=4 align='center'><h3>LISTA DE PRECIOS MAYORISTAS</h3></td></tr>";
echo "<tr><td colspan=4 align='center'>No incluye descuentos ni bonificaciones</td></tr>";
echo "<tr><td bgcolor=$color align='center'>codigo</td>
<td bgcolor=$color colspan=2>descripcion</td>
<td bgcolor=$color align='center'>precio</td>
</tr>";
$categoria="juan_perez";
while($f=mysql_fetch_array($res)){
if(trim($f[3]) == $categoria){
$f[1]=utf8_decode($f[1]);
$f[2]=number_format($f[2],2);
echo "<tr><td width='90' align='center'>$f[0]</td><td width='400'>$f[1]</td><td align=center width='15'>$</td><td align='center' width='80'>$f[2]</td>";
}else{
$f[3]=utf8_decode($f[3]);
$f[1]=utf8_decode($f[1]);
$f[2]=number_format($f[2],2);
echo "<tr><td colspan='4' align='center'><font color='orange'><strong><h3>$f[3]</h3></strong></font></td></tr>";
echo "<tr><td width='90' align='center'>$f[0]</td><td width='400'>$f[1]</td><td align=center width='15'>$</td><td align='center' width='80'>$f[2]</td>";
$categoria=trim(utf8_encode($f[3]));
}
}
echo "<tr><td colspan=4><b>IMPORTANTE: despachos al interior en 24 hs.<br/> Precios sujetos a modificacion sin previo aviso.</td>";
/*
echo "<tr>\n";
echo "<th>Nombre</th>\n";
echo "<th>Email</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font color=green>Manuel Gomez</font></td>\n";
echo "<td>[email protected]</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font color=blue>Pago gomez</font></td>\n";
echo "<td>[email protected]</td>\n";
echo "</tr>\n";
*/
echo "</table>";
?>