Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/12/2004, 14:49
nana_01
 
Fecha de Ingreso: octubre-2004
Mensajes: 101
Antigüedad: 20 años, 6 meses
Puntos: 0
abrir un reporte de crystal en una nueva ventana

hola chicos.............. espero ke esten bien...........

mi pregunta es bastante sencilla y creo ke tambien la solucion

les cuento yo soy nueva en este asunto de asp y muchas nueva en lo ke son repostes de crystal

empesemos del principio tengo el siguiente codigo

reportname = "rp_dinaDirectorio.rpt"

'CREATE THE APPLICATION OBJECT
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If

'CREATE THE REPORT OBJECT
Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

path = path & "Reportes\"


'OPEN THE REPORT (but destroy any previous one first)
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = false


Dim crtable, LoginSQL, SenhaSQL

LoginSQL = "AAAAA"
SenhaSQL = "XXXX"

set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo "INDICE_SQL", cstr(LoginSQL),cstr(SenhaSQL)

On Error Resume Next
session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.Write "The Error Message was: " & Err.Description & "from: " & Err.Source
set session("oPageEngine") = nothing
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If

End Sub
%>

<%
Sub Inicio()
Dim listaDos, seleccion
Dim desde, hasta, boton
Dim i

listaDos = Request.Form("list2")
seleccion = Request.Form("RdSeleccion")
desde = Request.Form("TxtDesde")
hasta = Request.Form("TxtHasta")
boton = Request.Form("excel")
Response.write " Lista " & listaDos & "<br>"
Response.write " RdSeleccion " & seleccion & "<br>"
Response.write " desde " & desde & "<br>"
Response.write " hasta " & hasta & "<br>"
Response.write " boton " & boton & "<br>"

Call Tabulado_Crystal(listaDos,seleccion,desde,hasta)
End Sub

Call Inicio()
%>

<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="lib_css/estilo.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = "rptserver.asp"
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport


End Sub
-->
</SCRIPT>
</head>

<body ONLOAD="VBScript:Page_Initialize">
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=100% HEIGHT=100% codebase="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,224">
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="600" height="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><table width="500" height="226" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#330066" bgcolor="#FFFFFF">
<tr>
<td height="224"><form name="form1" method="post" action="">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">&nbsp;</td>
</tr>
<tr>
<td align="center"><img src="imagenes/columna1.jpg" width="128" height="85"></td>
</tr>
<tr>
<td align="center">&nbsp;</td>
</tr>
<tr>
<td align="center" class="txt_negrita_01">Se gener&oacute; exportacion sin problemas </td>
</tr>
<tr>
<td height="25">&nbsp;</td>
</tr>
<tr>
<td align="center"><input name="volver" type="reset" class="btn_cyan" id="volver2" value="Volver" Onclick="javascript:window.location.href='InformeD irec.asp'"></td>
</tr>
<tr>
<td height="30" align="right">&nbsp;</td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
sub DestroyObjects(ByRef ObjectToDestroy)
If isobject(ObjectToDestroy) then
set ObjectToDestroy = nothing
End if
End sub

DestroyObjects(session("oPageEngine"))
DestroyObjects(session("oRpt"))
DestroyObjects(session("oApp"))
%>


no tengo problemas con la llamada del reporte

epro mi pregunta es....... si se puede abrir este reporte en una nueva ventana del explorer? he intentado varias veces de hacerlo pero no me resulta

me podrian ayudar por favor se los agradeceria un monton

de antemano muchas gracias