Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/03/2007, 11:46
Avatar de Viejari
Viejari
 
Fecha de Ingreso: marzo-2007
Mensajes: 9
Antigüedad: 17 años, 2 meses
Puntos: 0
Re: Pasar a PDF sin CrystalReportViewer

Hola Arturo, ojalá te sirva esto...
agrega un label en tu aspx, luego en el .vb lo llamas así despues de cargar todos los datos.:

lblJavascript.Text = "<script>window.open('fr_certificadoPDF.aspx','Cer tificado','scrollbars=yes,menubar=no, location=no, resizable=yes');</script>"

así lo tingo hecho yo:

En el html del aspx:

<table cellSpacing="0" cellPadding="0" width="486" border="0">
<tr vAlign="top">
<td><asp:label id="lblJavascript" runat="server"></asp:label></td>
</tr>
</table>

y en en mi archivo .vb lo llamo asÍ:
lblJavascript.Text = "<script>window.open('fr_certificadoPDF.aspx','Cer tificado','scrollbars=yes,menubar=no, location=no, resizable=yes');</script>"
la pagina 'fr_certificadoPDF.aspx' es así:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="fr_certificado.aspx.vb" Inherits="wwwBeneficios.frcertificado" %>
<script language="Javascript">
<!-- Begin
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
// End -->
</script>
<script language=JavaScript>
<!--
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!docum ent.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document. onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontext menu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
<html>
<head>
<title>Certificado</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
</head>

<frameset rows="66,*" cols="85%" frameborder="NO" border="0" framespacing="0">
<frame src="titulo.aspx" name="titulo">
<frame src="<% response.write(Session("strPaginaCertificadoHTM") & "?ID=" & Request.QueryString("ID")) %>" name="certificado">

</frameset>
</html>
////////////////////
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Validar session
Dim Funciones As New wwwGeneral.CuprumFunctions
Dim Logueado As Boolean
Dim strRuta As String
strRuta = Funciones.ValidaSession(Session("strRut"), Logueado)
If Not Logueado Then
Response.Redirect(strRuta)
End If
End Sub


Ojalá te sirva.

Salu2