Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: crystal report Post Reply Post New Topic
Author Message
chester
Newbie
Newbie
Avatar

Joined: 10 Jun 2013
Location: Philippines
Online Status: Offline
Posts: 2
Quote chester Replybullet Topic: crystal report
     Posted: 11 Jun 2013 at 5:34pm
can anyone tell how to pull the data in my table to crystal report. example,i loggedin,date and time will be saved on my table.the report must display the time i logged in. this is my code in my form


If ComboBox1.Text = "Shift 1" Then
               Dim rpt As New EndofShift() 'The report you created.
               Dim MyCommand As New SqlCommand()
               Dim myDS2 As New loghistory() 'The DataSet you created.
               Dim myDA2 As New SqlDataAdapter()
               Dim myDS As New DSactualguesting() 'The DataSet you created.
               Dim myDA As New SqlDataAdapter()
               Dim cn As New SqlConnection(ConnectString())

               Try

                    MyCommand.Connection = cn
                    MyCommand.CommandText = "Select * from actualguesting"
                    MyCommand.CommandType = CommandType.Text
                    myDA.SelectCommand = MyCommand
                    myDA.Fill(myDS, "actualguesting")


                    myDA.SelectCommand.CommandText = "Select * from loghistory where username='" + Login.txtuser.Text + "'"
                    myDA.Fill(myDS, "loghistory")

                    myDS.EnforceConstraints = False
                    rpt.SetDataSource(myDS)
                    CrystalReportViewer1.ReportSource = rpt
               Catch Excep As Exception
                    MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
               End Try
            End If

Edited by chester - 11 Jun 2013 at 5:34pm
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum