Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_espanol thread: =?iso-8859-1?Q?RE:_=5Baspx=5Fespanol=5D_RE:_=5Baspx=5Fespanol=5D_Re:_? =?iso-8859-1?Q?crystal_report_viewer_'logon_failed'_=28no_puedo_m=E1s=29?=


Message #1 by "Mauricio Solano O" <msolano@s...> on Thu, 12 Dec 2002 14:43:36 -0500
Hola Fernando.

estoy utilizando tu código pero no he entendido a que te refieres con esta
línea
 Pagina_belzart.net.rpt_est_cuenta_insti()

me puedes ayudar ?


Gracias

Mauricio



-----Mensaje original-----
De: Fernando Lobos [mailto:flobos@b...]
Enviado el: Miércoles, 11 de Diciembre de 2002 05:24 a.m.
Para: ASP.Net en Español
Asunto: [aspx_espanol] RE: [aspx_espanol] Re: crystal report viewer
'logon failed' (no puedo más)


Aquí esta este codigo y funcion muy bien exelente


Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class estado_cuenta_insti
    Inherits System.Web.UI.Page
    Dim crReportDocument As Pagina_belzart.net.rpt_est_cuenta_insti
    Dim crDatabase As Database
    Dim crTables As Tables
    Dim crTable As Table
    Dim crTableLogOnInfo As TableLogOnInfo
    Dim crConnectionInfo As ConnectionInfo
    Dim crParameterFields As New ParameterFields()
    Dim crParameterField As New ParameterField()
    Protected WithEvents CrystalReportViewer1 As
CrystalDecisions.Web.CrystalReportViewer
    Dim crParameterDiscreteValue As New ParameterDiscreteValue()

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
        crReportDocument = New Pagina_belzart.net.rpt_est_cuenta_insti()
        crConnectionInfo = New ConnectionInfo()
        With crConnectionInfo
            .ServerName = "server"
            .DatabaseName = "Base datos"
            .UserID = "user"
            .Password = "tupassword"
        End With
        crDatabase = crReportDocument.Database
        crTables = crDatabase.Tables
        For Each crTable In crTables
            crTableLogOnInfo = crTable.LogOnInfo
            crTableLogOnInfo.ConnectionInfo = crConnectionInfo
            crTable.ApplyLogOnInfo(crTableLogOnInfo)
        Next

        CrystalReportViewer1.ReportSource = crReportDocument
        crParameterFields = CrystalReportViewer1.ParameterFieldInfo
        crParameterField = crParameterFields.Item("@fic_idn")
        crParameterDiscreteValue = New ParameterDiscreteValue()
        crParameterDiscreteValue.Value 
Page.Request.QueryString("fic_idn")
        crParameterField.CurrentValues.Add(crParameterDiscreteValue)
        crParameterFields.Add(crParameterField)
        CrystalReportViewer1.ParameterFieldInfo = crParameterFields
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

    End Sub

End Class

-----Mensaje original-----
De: Ramiro Escobar [mailto:ramiroescobar@h...]
Enviado el: miércoles, 11 de diciembre de 2002 12:41
Para: ASP.Net en Español
Asunto: [aspx_espanol] Re: crystal report viewer 'logon failed' (no
puedo más)

> ¿alguien consiguió publicar informes en una web con crystal reports
sin
o> btener el maldito error 'logon failed'?

>
H> e intentado de todo.

> Incluso he definido todos los datos a mano

> crystalreportviewer.reportsource=server.mappath("mi_reporte.rpt")
c> rystalreportviewer.LogOninfo.item
(0).connectioninfo.password="mipassword"
c>
rystalreportviewer.LogOninfo.item(0).connectioninfo.server="mi_server"
c>
rystalreportviewer.LogOninfo.item(0).connectioninfo.userid="mi_userid"

> y así tampoco funciona.

> Uso una conexión ADO y el RPT lo he generado previamente con el
asistente
q> ue viene en el IDE de Visual studio NET.
¿> Álguien sabe algo sobre el tema?
T> oda la documentación que encuentro no vale ninguna para mierda.

> ayudaaaaaaaaaaaaaaaaaaaaaaa


A ver si te sirve este código: yo hago un reporte que como datasource
tenga un dataset (dsLoan).

Mi código es el siguiente (y funciona bien):

Imports System
Imports System.Globalization
Imports System.Threading
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Public Class RepPtmosResumCalif
  Inherits System.Web.UI.Page
  Protected WithEvents Label1 As System.Web.UI.WebControls.Label
  Protected WithEvents calFechaCalif As
System.Web.UI.WebControls.Calendar
  Protected WithEvents btnReporte As System.Web.UI.WebControls.Button
  Protected WithEvents hylMain As System.Web.UI.WebControls.HyperLink
  Protected WithEvents DsLoan1 As LoanSys.cpd00.dsLoan
  Private ws As New cpd00.clsLoanSysWS()

#Region " Web Form Designer Generated Code "

  'This call is required by the Web Form Designer.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
    Me.DsLoan1 = New LoanSys.cpd00.dsLoan()
    CType(Me.DsLoan1,
System.ComponentModel.ISupportInitialize).BeginInit()
    '
    'DsLoan1
    '
    Me.DsLoan1.DataSetName = "dsLoan"
    Me.DsLoan1.Locale = New System.Globalization.CultureInfo("en-US")
    Me.DsLoan1.Namespace = "http://tempuri.org/dsLoan.xsd"
    CType(Me.DsLoan1,
System.ComponentModel.ISupportInitialize).EndInit()

  End Sub

  Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
  End Sub

#End Region

  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
    If Not Page.IsPostBack Then
      Me.calFechaCalif.SelectedDate = Date.Today
    End If
  End Sub

  Private Sub btnReporte_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles btnReporte.Click
    Dim aa As New EmitirReporte()
    Me.DsLoan1.Merge(ws.GetResumCalif(Me.calFechaCalif.SelectedDate))

    With aa
      .MapPath = Me.Page.MapPath("")
      .Reporte = "PtmosResumCalif.rpt"
      .Sesion = Session.SessionID.ToString
      '.Formula = "{CuentaBal.PctasCod} >= " & Chr(34) &
Me.txtPrimeraCta.Text & Chr(34) & " and {CuentaBal.PctasCod} <= " & Chr
(34) & Me.txtUltimaCta.Text & Chr(34)
    End With


    Dim crRD As New ReportDocument()
    Dim crDisk As New DiskFileDestinationOptions()
    'If Me.rdbExcel.Checked = True Then
    aa.ExtensionFile = "xls"
    'ElseIf Me.rdbWord.Checked = True Then
    'aa.ExtensionFile = "doc"
    'Else
    '  aa.ExtensionFile = "pdf"
    'End If
    crDisk.DiskFileName = aa.FileName
    crRD.Load(aa.Reporte)
    'crRD.DataDefinition.RecordSelectionFormula = aa.Formula

    crRD.SetDataSource(Me.DsLoan1)

    Dim discreteParam As New ParameterDiscreteValue()
    Dim paramField As ParameterFieldDefinition
    paramField = crRD.DataDefinition.ParameterFields.Item("LaFecha")
    discreteParam.Value = Format(Me.calFechaCalif.SelectedDate, "dd MMMM

yyyy")
    Dim currentValues As New ParameterValues()
    currentValues.Add(discreteParam)
    paramField.ApplyCurrentValues(currentValues)

    Dim cEO As ExportOptions
    cEO = crRD.ExportOptions

    With cEO
      .DestinationOptions = crDisk
      .ExportDestinationType = ExportDestinationType.DiskFile
      'If Me.rdbExcel.Checked = True Then
      .ExportFormatType = ExportFormatType.Excel
      'ElseIf Me.rdbWord.Checked = True Then
      '.ExportFormatType = ExportFormatType.WordForWindows
      'Else
      '  .ExportFormatType = ExportFormatType.PortableDocFormat
      'End If
    End With

    crRD.Export()

    'para desplegar en la misma pantalla
    Response.ClearContent()
    Response.ClearHeaders()

    'If Me.rdbExcel.Checked = True Then
    Response.ContentType = "application/vnd.ms-excel"
    'ElseIf Me.rdbWord.Checked = True Then
    'Response.ContentType = "application/msword"
    'Else
    '  Response.ContentType = "application/pdf"
    'End If

    Response.WriteFile(aa.FileName)
    Response.Flush()
    Response.Close()


  End Sub
End Class

La clase EmitirReporte arregla las variables:

Public Class EmitirReporte
  Private mReporte As String
  Private mSesion As String
  Private mMapPath As String
  Private mFormula As String
  Private mFileName As String
  Private mExtFile As String
  Public Property Reporte() As String
    Get
      Return mReporte
    End Get
    Set(ByVal Value As String)
      mReporte = Me.MapPath & "\" & Value
    End Set
  End Property
  Public Property Sesion() As String
    Get
      Return mSesion
    End Get
    Set(ByVal Value As String)
      mSesion = Value
    End Set
  End Property
  Public Property MapPath() As String
    Get
      Return mMapPath
    End Get
    Set(ByVal Value As String)
      mMapPath = Value
    End Set
  End Property
  Public Property Formula() As String
    Get
      Return mFormula
    End Get
    Set(ByVal Value As String)
      mFormula = Value
    End Set
  End Property
  Public Property FileName() As String
    Get
      mFileName = Me.MapPath & "\Reportes\" & Me.Sesion & "." &
Me.ExtensionFile
      Return mFileName
    End Get
    Set(ByVal Value As String)
      mFileName = Value
    End Set
  End Property
  Public Property ExtensionFile() As String
    Get
      Return mExtFile
    End Get
    Set(ByVal Value As String)
      mExtFile = Value
    End Set
  End Property
End Class

Espero te sirva de algo.
Saludos
Ramiro
---
Usted está suscrito a aspx_espanol como:
flobos@b...
Para darse de baja, envíe un mensaje en blanco a
%%email.unsub%%




---
Usted está suscrito a aspx_espanol como:
msolano@s...
Para darse de baja, envíe un mensaje en blanco a
%%email.unsub%%



  Return to Index