Results 1 to 2 of 2

Thread: help with crystal viewer

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    1

    Question help with crystal viewer

    hi , my name is Yuliana , i have a problem with my crystalviewer in vb 2005, i need to know how i send the paramaters to a crystal reports and show the report in the viewer pleas i need help this is all i have


    Dim cr As New crSaldo
    cr.SetDataSource(datos1.Tables(0))
    cr.SetDatabaseLogon("sa", "diamantes")

    the way i do un vb 2003 was diferent please ... need help ..tanks

  2. #2
    Lively Member
    Join Date
    Apr 2006
    Posts
    68

    Re: help with crystal viewer

    G'd evening Yulis!
    I'm don't know how it works in vb 2k5, but in 2k3 the sintax (for external report) might be like this:
    Code:
    Imports CrystalDecisions.CrystalReports.Engine
    
    Private anySub()
    Dim rpt As New ReportDocument
    
    rpt.Load("c:\YourReport.rpt")
    rpt.SetParameterValue("@sqlParameter", parameterValue)
    CrystalReportViewer.ReportSource = rpt
    End Sub
    If the report is part of your solution, you can use the cr viewer load event. Something like this:

    Code:
    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object,ByVal 
    As System.EventArgs) Handles CrystalReportViewer1.Load
    
    Dim myReport As CrystalDecisions.CrystalReports.Engine.ReportDocument
    myReport = New YourReport
    CrystalReportViewer1.ReportSource = myReport
    End Sub
    Good luck
    Estuardo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width