I have a problem when exporting the data to Excel, the Residence Number fields and misinterpreted by EXCEL
Example: if the client places in the field number of residence 100 A, it goes normal, more if it puts below 24, type 23 A, EXCEL interprets this as time and puts 23:00:00
The same thing happens if the client puts this way 8-10, which corresponds to Block 8 Ap 10, EXCEL interprets as date, 10/08/2016
I have already added the field of add-on, but it does not work, the client still puts information in the field number, I have limited the number field only to numbers, there the customer places the same thing in the add-on field, and gives me the same error! :
In the database records everything right, just the stick when exporting.
I did not want to migrate to the PHPExcel class, but I think if I do not have it, I'll have to deploy it, but I do not know if that will solve it!
This is the code for generating XML
for($i=0;$i<1;$i++){
$html[$i] .= "<table>";
$html[$i] .= "<tr>";
$html[$i] .= "<td><b>Nome</b></td>";
$html[$i] .= "<td><b>Email</b></td>";
$html[$i] .= "<td><b>CPF</b></td>";
$html[$i] .= "<td><b>Cep</b></td>";
$html[$i] .= "<td><b>Endereço</b></td>";
$html[$i] .= "<td><b>Numero</b></td>";
$html[$i] .= "<td><b>Complemento</b></td>";
$html[$i] .= "<td><b>Bairro</b></td>";
$html[$i] .= "<td><b>Cidade</b></td>";
$html[$i] .= "<td><b>UF</b></td>";
$html[$i] .= "<td><b>Status do cliente</b></td>";
$html[$i] .= "</tr>";
$html[$i] .= "</table>";
}
$i = 1;
$html[$i] .= "<table>";
$html[$i] .= "<tr>";
$html[$i] .= "<td>$nome_cad_cod</td>";
$html[$i] .= "<td>$email_cad</td>";
$html[$i] .= "<td>$cpf_cad</td>";
$html[$i] .= "<td>$cep_cad</td>";
$html[$i] .= "<td>$endereco_cad</td>";
$html[$i] .= "<td>$numero_cad</td>";
$html[$i] .= "<td>$complemento_cad</td>";
$html[$i] .= "<td>$bairro_cad</td>";
$html[$i] .= "<td>$cidade_cad</td>";
$html[$i] .= "<td>$estado_cad</td>";
$html[$i] .= "<td>Pagseguro</td>";
$html[$i] .= "</tr>";
$html[$i] .= "</table>";
$i++;
}
$arquivo = 'relatorio.xls';
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header ("Content-type: application/x-msexcel");
header ("Content-Disposition: attachment; filename={$arquivo}" );
header ("Content-Description: PHP Generated Data" );
for($i=0;$i<=$result->num_rows;$i++){
echo $html[$i];
}