Ver Mensaje Individual
  #14 (permalink)  
Antiguo 19/03/2010, 12:18
Avatar de DanX03
DanX03
 
Fecha de Ingreso: septiembre-2007
Ubicación: México D.F.
Mensajes: 148
Antigüedad: 17 años, 6 meses
Puntos: 3
Respuesta: Exportar a word

He encontrado una posible respuesta:


Código ASP:
Ver original
  1. <%
  2. response.ContentType ="application/msword"
  3. fechaini=request.QueryString("fechaini")
  4. fechafin=request.QueryString("fechafin")%>
  5. <!--#include file="variables.asp"-->
  6. <html>
  7. <head>
  8. <title>Word Test</title>
  9. <meta name="Author" content="Acme Toys">
  10. </head>
  11. <style type="text/css">
  12.  
  13. .BigTitle {
  14. font-family: Verdana, Sans-Serif;
  15. font-size: 20pt;
  16. font-weight: bold;
  17. color: #004080;
  18. }
  19.  
  20. .UserDetails {
  21. font-family: Courier New, Monospace;
  22. font-size: 12pt;
  23. }
  24.  
  25. </style>
  26. <body>
  27. <%conectar()
  28.  
  29.  
  30. sqla="select a.fecha_odt,b.cliente,a.proyecto,c.descripcion,a.realizo,clasificacion from (select fecha_odt,cliente,proyecto,"&_
  31.     "descripcion,realizo,(case when clasificacion=1 then 'CALLCENTER' when clasificacion=2 then 'ADMINISTRATIVO' when clasificacion=3 then "&_
  32.     "'BASE DE DATOS' end) clasificacion from desarrollo.bitacora_desarrollo where fecha_odt between convert(datetime,'"&fechaini&"',103) "&_
  33.     "and convert(datetime,'"&fechafin&"',103)+1) a left join (select id,nombre as cliente from desarrollo.clientes09 where area=1) b on "&_
  34.     "a.cliente=b.id left join (select id_req,descripcion,actividad from desarrollo.cat_requerimientos) c on a.descripcion=c.id_req "&_
  35.     "order by a.clasificacion,a.fecha_odt,a.realizo"
  36. 'response.Write(sqla)
  37. 'response.End()
  38. rs.Open sqla, conn
  39.  
  40. 'wrdApp.Visible = True
  41. %>
  42. <table width="100%">
  43.   <tr>
  44.     <td width="25%">Asunto</td>
  45.     <td width="25%">Detalle</td>
  46.     <td width="25%">Responsable</td>
  47.     <td width="25%">Fecha Compromiso</td>
  48.   </tr>
  49. <%while not rs.eof%>
  50.   <tr>
  51.     <td><%=rs(1)%></td>
  52.     <td><%=rs(3)%></td>
  53.     <td><%=rs(4)%></td>
  54.     <td><%=rs(0)%></td>
  55.   </tr>
  56. <%rs.movenext
  57. wend%>
  58. </table>
  59. </p>
  60. </body>
  61.  
  62. </html>

Solo que si le agrego este include
Código ASP:
Ver original
  1. <!--#include file="reporte_desarrollo.doc"-->
Que es donde tengo el formato con encabezado y pie de pagina definidos, solo abre el documento sin ningun valor.

Última edición por DanX03; 19/03/2010 a las 12:34