Originariamente inviato da fermat
per curiosità mi potresti dire come hai creato il foglio xls in maniera automatizzata??

per la tua richiesta potresti vedere se PHPExcel ha qualche funzione adatta allo scopo.

Ciao fermat ti posto tutto lo script che ho creato. Poi naturalmente personalizzalo secondo le tue esigenze.

<?php
$connessione = mysql_connect("localhost","root","")or die("Connessione non riuscita: " . mysql_error());
print ("");

mysql_select_db("donato", $connessione) or die("Errore nella selezione del database");

$contr_numero=$_GET['contr_numero'];
$RAG_SOC=$_GET['RAG_SOC'];

$filename = "$RAG_SOC'_'$contr_numero'_dettaglio'.xls";
header ("Content-Type: application/vnd.ms-excel");
header ("Content-Disposition: inline; filename=$filename");

?>

<!-- iniziamo a costruire la nostra tabella --/>

<html><head><title>Export</title></head><body>

<table border="1">
<tr>

<th>numero telefonico</th>
<th>SIM Fonia/Dati</th>
<th>Servizio blackberry easy mail</th>
<th>Servizio blackberry Full</th>
<th>servizio blackberry top mail</th>
<th>Bundle dati 20 GB*</th>
<th>Bundle dati 2GB**</th>
<th>TIM DUO base</th>
<th>TIM DUO Messaggi (1)</th>
<th>TIM DUO Messaggi (2)</th>
<th>TIM DUO Messaggi (3)</th>
<th>TIM DUO ROMING</th>
<th>TIM DUO personal DATI</th>
<th>TWIN CARD business</th>
<th>TWIN CARD mobile office</th>

</tr>

<?php

$sql="SELECT * FROM sts WHERE contr_numero=$contr_numero"; // selezioniamo i dati dalla nostra tabella
$query=@mysql_query($sql) or die (mysql_error());

while ($row=mysql_fetch_array($query)) // ed effettuiamo un ciclo per creare le righe della nostra tabella
{

$numero_telefonico = $row['numero_telefonico'];
$TIPO_LINEA = $row['TIPO_LINEA'];
$PA4BLACKBERRYEASYMAIL = $row['PA4BLACKBERRYEASYMAIL'];
$PA4BLACKBERRYFULL = $row['PA4BLACKBERRYFULL'];
$PA4BLACKBERRYTOPMAIL = $row['PA4BLACKBERRYTOPMAIL'];
$PA4DATI10GB = $row['PA4DATI10GB'];
$PA4DATI500MB = $row['PA4DATI500MB'];
$TIMDUO = $row['TIMDUO'];
$TIMDUOPLUSMESSAGGI = $row['TIMDUOPLUSMESSAGGI'];
$TIMDUOPLUSMMSBASIC = $row['TIMDUOPLUSMMSBASIC'];
$TIMDUOPLUSSMSBASIC = $row['TIMDUOPLUSSMSBASIC'];
$TIMDUOROAMINGON = $row['TIMDUOROAMINGON'];
$TIMPERSONALDATI = $row['TIMPERSONALDATI'];
$TWINCARDBUSINESS = $row['TWINCARDBUSINESS'];
$TWINCARDMOBILEOFFICE = $row['TWINCARDMOBILEOFFICE'];

?>
<tr>
<?php

echo "<td>$numero_telefonico</td>";
echo "<td>$TIPO_LINEA</td>";
echo "<td>$PA4BLACKBERRYEASYMAIL</td>";
echo "<td>$PA4BLACKBERRYFULL</td>";
echo "<td>$PA4BLACKBERRYTOPMAIL</td>";
echo "<td>$PA4DATI10GB</td>";
echo "<td>$PA4DATI500MB</td>";
echo "<td>$TIMDUO</td>";
echo "<td>$TIMDUOPLUSMESSAGGI</td>";
echo "<td>$TIMDUOPLUSMMSBASIC</td>";
echo "<td>$TIMDUOPLUSSMSBASIC</td>";
echo "<td>$TIMDUOROAMINGON</td>";
echo "<td>$TIMPERSONALDATI</td>";
echo "<td>$TWINCARDBUSINESS</td>";
echo "<td>$TWINCARDMOBILEOFFICE</td>";
}
?>
</tr>
</table>
</body>
</html>


Ciao
JerryLeeLewis