Foros del Web » Programando para Internet » ASP Clásico »

Problemas de Exportar consulta a excel para windows 2000

Estas en el tema de Problemas de Exportar consulta a excel para windows 2000 en el foro de ASP Clásico en Foros del Web. Tengo un archivo asp donde esta incluido un script que me genera la consulta de un recorset a excel. El problema es que no se ...
  #1 (permalink)  
Antiguo 24/07/2003, 09:46
 
Fecha de Ingreso: enero-2002
Mensajes: 12
Antigüedad: 23 años, 4 meses
Puntos: 0
Problemas de Exportar consulta a excel para windows 2000

Tengo un archivo asp donde esta incluido un script que me genera la consulta de un recorset a excel. El problema es que no se porque para windows 2000 no me arroja ningun resultado es decir la hoja electronica me sale en blanco, pero para windows xp y milenium me sale correctamente. Por su colaboración, gracias.

<%@ Language=VBScript %>
<!--#INCLUDE file="include.inc"-->
<!--#include file="adovbs.inc" -->

<%

if len(trim(SESSION("fosygacon_ConnectionString"))) = 0 then
response.write "<SCRIPT LANGUAGE=JAVASCRIPT> " &_
"window.open('/cgi/logon.asp? spid=ECAT_PER','LOGON','menubar=no,toolbar=no,loca
tion=no,scrollbars=no,width=200,height=380');" &_
"</SCRIPT>"
ELSE
%>

<html>
<head>
<title>Consulta de ECAT</title>
<link rel="stylesheet" href="/estilos.css" type="text/css">

<script language=javascript>
<!--
function planilla(){
f_excel = document.form1.f_excel.checked
mes_b = document.form1.mes_b.value
ano_b = document.form1.ano_b.value
consulta_pl = window.open ('estado_cta_lista.asp?f_excel='+f_excel+'&mes_b=' +mes_b+'& ano_b='+ano_b,'consulpl','width=550,height=400,scr
ollbars=yes,menubar=yes,left=0,top=0,resizable=yes
')

}
-->
</script>


<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!--
function openwindow(nurl,namew) {
newwindow = window. open(nurl,namew,'menubar=yes,toolbar=no,location=n
o,scrollbars=yes,width=780,height=480,left=0,top=0
');
}
-->
</SCRIPT>
</head>

<body bgcolor=#EFFFE7>

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="684">
<tr valign="top">
<td height="183" colspan="2">
<!--#include file="../ecat/top_ecat.htm"-->
</td>
</tr>
<tr valign="top">
<td height="5" colspan="2" bgcolor="#99CC66"><img src="/images/head_r5_c1.gif" width="178" height="20"></td>
</tr>
<tr>
<td height="0" width="22%" valign="top" rowspan="2" background="/images/fondo_left.gif">
<!--#include file="../ecat/left_ecat.htm"-->
</td>
<%if request.form("ano_b") = "" then
%>
<td class="some" valign="top" width="80%"><b>Consultas
&gt; Estado de Cuenta ECAT Personas Jurídicas por Período</b><br>
<p><font color=red><b>
Si desea los resultados de la consulta en hoja electrónica MS Excel, active la opción "Resultados hoja electrónica".</font></b>
<form method="post" action="/cgi/consulta_ecat01_periodo.asp" id="form1" name="form1">

<table width="100%" border="0" cellspacing="0" cellpadding="5" bordercolor="#009999" bgcolor="#009999">
<tr bgcolor="#009999">
<td class="some" width="100%" height="2">
<div align="left"><font color="#FFFFFF"><b>Consultar el mes de</b></font></div>
</td>
<td width="516" height="2"></td>
</tr>
<tr>
<td class="some" width="60%"><b></b>
<select name="mes_b" size="1">
<option value="0" selected> </option>
<option value="1">Enero</option>
<option value="2">Febrero</option>
<option value="3">Marzo</option>
<option value="4">Abril</option>
<option value="5">Mayo</option>
<option value="6">Junio</option>
<option value="7">Julio</option>
<option value="8">Agosto</option>
<option value="9">Septiembre</option>
<option value="10">Octubre</option>
<option value="11">Noviembre</option>
<option value="12">Diciembre</option>
</select>
<select name="ano_b" size="1">
<option value="0" selected> </option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
</select>
<INPUT TYPE="checkbox" NAME="f_excel"><font color="#FFFF00">Resultados Hoja Electrónica </font>


<!-- <input type=submit value="Consultar"> -->
<input type="button" value="Consultar" name="B1" onclick="planilla()">
</td>

</tr>
</table>
<p></p>
</form>

<%
else
IF (Request.form ("Pagina") = "Siguiente") THEN
Session ("Pagina")= Session ("Pagina") + 1
ELSE IF (Request.form ("Pagina") = "Anterior") THEN
Session ("Pagina")= Session ("Pagina") - 1
ELSE Session ("Pagina")= 1
END IF
END IF
session("fecha1") = "01/" & request.form("mes_b") & "/" & request.form("ano_b")
'Server.ScriptTimeOut = 900000
set oADOConn = Server.CreateObject("ADODB.Connection")
oADOConn.ConnectionString = SESSION("fosygacon_ConnectionString")
oADOConn.ConnectionTimeOut = 15
oADOConn.CommandTimeOut = 15
oADOConn.cursorlocation = 3
oADOConn.Open
set ds_results = Server.CreateObject("ADODB.Recordset")
Set OBJdbCommand = Server.CreateObject("ADODB.Command")
OBJdbCommand.ActiveConnection = oADOConn
OBJdbCommand.CommandType = 4
OBJdbCommand.CommandTimeOut = 0
OBJdbCommand.CommandText = "sp_web_lista_recla"
set proc_param1 = OBJdbCommand.createparameter("ips",addouble,adPara mInput,,session("musr"))
OBJdbCommand.Parameters.Append proc_param1
set proc_param2 = OBJdbCommand.createparameter("f1", advarchar,adParamInput,10,session("fecha1"))
OBJdbCommand.Parameters.Append proc_param2
set ds_results = OBJdbCommand.EXECUTE
ds_results.PageSize=40


ds_results.AbsolutePage = Session ("Pagina")
%>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="90%" bgcolor="#808080">
<tr VALIGN="TOP">
<td class="some" bgcolor="#3535FF"><b><font color="white">Radicación</font></td>
<td class="some" bgcolor="#3535FF"><b><font color="white">Fecha</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Estado</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Apellidos</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Nombres</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Cta. No.</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Días Promedio Aprobadas</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Días Promedio Negadas</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Días Promedio Aprobadas</font></td>
<td class="some" bgcolor="#3535FF" ><b><font color="white">Consecutivo Paquete</font></td>
</tr>

<% IF not ds_results.EOF THEN
registro = 0
Do while registro < 40 and not ds_results.EOF
modulo = registro mod 2%>
<tr BGCOLOR="#FFeFd5" VALIGN="TOP">
<td ALIGN="left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><font face="Verdana, Arial, Helvetica" size="1">
<!--<a href="/cgi/consulta_ecat01.asp?num_radicacion=<%=ds_results(" num_radicacion")%>"><%=ds_results("num_radicacion" )%></a>-->
<A HREF=javascript:openwindow("/cgi/consulta_ecat01.asp?num_radicacion=<%=ds_results(" num_radicacion")%>",'<%=ds_results("num_radicacion ")%>')>
<%=ds_results("num_radicacion")%>
</a>
</font></td>
<td class="some" ALIGN="left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("fecha_cap")%></td>
<td class="some" ALIGN="left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("estado")%></td>
<td class="some" ALIGN="Left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("apellidos_accidentado")%></td>
<td class="some" ALIGN="Left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("nombres_accidentado")%></td>
<td class="some" ALIGN="Left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("cta_cobro")%></td>
<td class="some" ALIGN="Left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("dias_promedio_aprobadas")%></td>
<td class="some" ALIGN="Left"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("dias_promedio_negadas")%></td>
<td class="some" ALIGN="center"<%if modulo = 0 then%>bgcolor="#FFFFFF"<%end if%>
><%=ds_results("cons_paquete")%></td>
</tr>
<% registro = registro + 1
ds_results.MoveNext
loop %>
</table>
<center>

<%Response.Write cstr(ds_results.RecordCount) + " registros encontrados"%><br>
<%Response.Write "Página " + cstr(Session ("Pagina")) + " de " + cstr(ds_results.PageCount)%>

<form method="post" action="/cgi/consulta_ecat01_periodo.asp" id="form1" name="form1">
<INPUT TYPE="hidden" VALUE="<%=request.form("mes_b")%>" NAME="mes_b">
<INPUT TYPE="hidden" VALUE="<%=request.form("ano_b")%>" NAME="ano_b">
<%
IF Session ("Pagina") > 1 THEN %>
<INPUT TYPE="Submit" VALUE="Anterior" NAME="Pagina">
<% END IF
IF Session ("Pagina") < ds_results.PageCount THEN %>
<INPUT TYPE="Submit" VALUE="Siguiente" NAME="Pagina">
</center>
<%END IF ' el de session("pagina")
else
response.write f_goback("No se encuentra información para el período solicitado.")
end if ' el de IF not ds_results.EOF
end if 'el de if request.form("ano_a") = "" or request.form("ano_b") = ""

%>
</form>
</td>
</tr>
<tr>
<td height="155" width="78%" valign="top">
<!--#include file="../footer.htm"-->
</td>
</tr>
<tr>
<td height="3" width="22%" background="/images/fondo_bottom.gif"><img src="/images/bottom.gif" width="168" height="23"></td>
<td height="3" width="78%" background="/images/fondo_bottom.gif"> </td>
</tr>
</table>
</body>
</html>
<%END IF ' el de SESSION("fosygacon_ConnectionString") = ""
%>
  #2 (permalink)  
Antiguo 24/07/2003, 10:30
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 2 meses
Puntos: 535
Pero no veo dónde estás generando el XLS!
Creo que ahí debería estar el problema.

Una consulta... el XLS lo generás en el cliente o en el servidor?
Por que si es en el servidor, no debería haber problemas de versiones del Office o del S.O.
__________________
...___...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:38.