Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/01/2012, 17:43
cesar_viridi
 
Fecha de Ingreso: enero-2012
Ubicación: Mexico Df
Mensajes: 95
Antigüedad: 12 años, 3 meses
Puntos: 6
al exportar a excel se pierde codificacion y colores

Hola buen dia a todo

Tengo un problema quiero exportar un tabla que es el resultado de una consulta
estooy empleado jquery, emplee esta forma http://webintenta.com/exportar-tablas-html-a-excel-con-php-y-jquery.html

en mi servidor de pruebas me exporta bien todo y con los colores bien y la codificaion tambien pero en mi servidor la exportacion la hace mal sin colores y sin codificacion

Esto uso para exportar la tabla

Código PHP:
header("Content-type: application/vnd.ms-excel; name='excel'");
header("Content-Disposition: filename=ficheroExcel.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo 
$_POST['datos_a_enviar']; 
si le añado una meta con el la codifcacion utf-8 o le añado header con la codificacion utf8 , ya no me generar el excel nada mas me muestra el html

y aparte miro el codigo de la pagina y me quita las comillas y me pone "\" un barra invertidad sobre los estilos

Código HTML:
Ver original
  1. <TABLE id=Exportar_a_Excel border=1 cellSpacing=0 width=\"95%\" align=center cellpading=\"0\">
  2. <TR>
  3. <TD style=\"BACKGROUND-COLOR: rgb(236,236,40)\" id=td_naranja height=96 align=middle><IMG align=left src=\"img/ci_logo.PNG\"><BR>
  4. <DIV id=titulo_estilo1><STRONG>REPORTE DE ENCUESTAS RECREMEX Y GEPROCAR<BR></STRONG><BR>
  5. <DIV id=font_negritas><STRONG>REPORTE DE 01/01/2012 A 25/01/2012</STRONG></DIV></DIV></TD>
  6. <TH style=\"BACKGROUND-COLOR: rgb(236,236,40)\" id=td_naranja align=middle>
  7. <DIV id=total_encuestas><STRONG>Total de encuestas: 23</STRONG></DIV></TH></TR>
  8. <TR>
  9. <TH style=\"BACKGROUND-COLOR: #ccc\" id=td_gris width=\"80%\"><STRONG>Preguntas</STRONG></TH>
  10. <TH style=\"BACKGROUND-COLOR: #ccc\" id=td_gris width=\"20%\"><STRONG>No. de Respuestas</STRONG></TH></TR>
  11. <TR>
  12. <TD style=\"BACKGROUND-COLOR: rgb(215,243,113)\" id=td_preguntas>1.- ¿Cual fue el motivo por el que acepto el trabajo ?</TD>
  13. <TD style=\"BACKGROUND-COLOR: rgb(215,243,113)\" id=td_preguntas></TD></TR>
  14. <TR>
  15. <TD style=\"ackground-color: #fff\" id=td_blanco>Estaba de vacaciones y decidí trabajar</TD>
  16. <TD style=\"ackground-color: #fff\" id=td_blanco align=middle>1</TD></TR>
  17. <TR>
  18. <TD style=\"ackground-color: #fff\" id=td_blanco>Me parecío atractivo trabajar por medio tiempo combinándolo con mis estudios.</TD>
  19. <TD style=\"ackground-color: #fff\" id=td_blanco align=middle>14</TD></TR>
  20. <TR>
  21. <TD style=\"ackground-color: #fff\" id=td_blanco>Necesitaba el empleo por dificultades económicas, aun cuando no tenia experiencia en el puesto.</TD>
  22. <TD style=\"ackground-color: #fff\" id=td_blanco align=middle>4</TD></TR>
  23. <TR>
  24. <TD style=\"ackground-color: #fff\" id=td_blanco>Ya tenia experiencia en el puesto, por lo que sabia que se me hiba a facilitar.</TD>
  25. <TD style=\"ackground-color: #fff\" id=td_blanco align=middle>3</TD></TR>
  26. <TR>
  27. <TD style=\"ackground-color: #fff\" id=td_blanco>Me interesoel puesto ya que tenia que convencer a la gente de algo (pagar / comprar)</TD>
  28. <TD style=\"ackground-color: #fff\" id=td_blanco align=middle>1</TD></TR>
  29. <TR>
  30. <TD style=\"BACKGROUND-COLOR: #ccc\" id=td_gris align=right>Total</TD>
  31. <TD style=\"BACKGROUND-COLOR: #ccc\" id=td_gris align=middle>
  32. <DIV id=font_negritas><STRONG>23</STRONG></DIV></TD></TR>


que puedo hacer? sera algo del php ini? algo de la version de php? o que puedo ser

Gracias