Results 1 to 10 of 10

Thread: Crystal Report with VS 2005

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    16

    Arrow Crystal Report with VS 2005

    Hi, I am trying to produce this with Crystal Report and VB 2005.
    The problem is that the following sql query works fine in Access, and I could get a perfect report out of it. however, when I trying to use this query in VB, data won't show in the crystal report. I don't even get an error on this code. So, I couldn't figure it out why I don't get the result on Crystal Report.
    by the way, the result should be 5 distinct records and no field is NULL.( that's what I got from ACCESS & DatagridView)
    So, would you help me?

    ===================================================

    Private Sub CRV1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CRV1.Load

    Dim s As String

    s = "SELECT FirstName, LastName, staff, a_time, reason FROM tblconsumer " & _
    "Join tblattendance on tblattendance.c_id = tblconsumer.c_id " & _
    "Join tblcode on tblattendance.a_id = tblcode.a_id " & _
    "WHERE tblattendance.a_date = @date"


    Dim today As String = Date.Now.ToString("MM/dd/yyyy")
    today = today & " 12:00:00 AM"

    RepdbDA.SelectCommand = New SqlCommand()
    RepdbDA.SelectCommand.Connection = RepdbConnection
    RepdbDA.SelectCommand.CommandText = s
    RepdbDA.SelectCommand.CommandType = CommandType.Text
    RepdbDA.SelectCommand.Parameters.AddWithValue("@date", today)

    RepdbDS = New DataSet()
    RepdbDA.Fill(RepdbDS, "rptdar")

    Dim dt As DataTable = New DataTable
    dt = RepdbDS.Tables(0)

    Dim DAReport = New rptdar() ' rptdar = new instance of C R
    DAReport.SetDataSource(dt)
    CRV1.ReportSource = DAReport

    End Sub
    Last edited by skinpower; Oct 26th, 2006 at 03:40 PM.

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