Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/01/2010, 10:24
klaudio83
 
Fecha de Ingreso: octubre-2009
Mensajes: 70
Antigüedad: 14 años, 6 meses
Puntos: 0
De acuerdo Respuesta: Reporte con crystal report desde BD mdf

Excelente ahora si que funciona!
Lo mas facil y sencillo, es hacer una vista que contenga los datos que se van a utilizar en el reporte.
Dejo el ejemplo por si a alguien mas le sirve.
Gracias eperedo, como siempre buena onda.

Código vb.net:
Ver original
  1. Private Sub visor_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.         tNum2Text = New cNum2Text
  3.  
  4.         Dim conexion As New SqlConnection(cadena)
  5.         Dim ds As New sistemaDataSet
  6.         Dim da As New SqlDataAdapter("SELECT * FROM VistaPrueba WHERE id_factura='" & idFactura & "'", conexion)
  7.  
  8.         Dim resultado As String
  9.         resultado = tNum2Text.Numero2Letra(total, , , "peso", , 1, ).ToUpper()
  10.  
  11.         Try
  12.             conexion.Open()
  13.             da.Fill(ds.VistaPrueba)
  14.             conexion.Close()
  15.  
  16.             Dim reporte As New CrystalReport1
  17.             reporte.SetDataSource(ds)
  18.  
  19.             Dim rptObject As ReportObject
  20.             rptObject = reporte.Section4.ReportObjects("txtvalor")
  21.             Dim txtValor As TextObject = DirectCast(rptObject, TextObject)
  22.             'txtValor.Text = "ESTO ES UN VALOR CUALQUIERA"
  23.             txtValor.Text = resultado
  24.  
  25.             Me.CrystalReportViewer1.ReportSource = reporte
  26.  
  27.             ds.Dispose()
  28.             da.Dispose()
  29.  
  30.         Catch ex As Exception
  31.             MsgBox("Mensaje : " & ex.Message)
  32.         End Try
  33.     End Sub