29-03-17, 07:37 PM
If objconn.State = ConnectionState.Closed Then objconn.Open()
Dim cmd3 As New OleDbCommand
cmd3.Connection = objconn
cmd3.CommandType = CommandType.Text
''''''''''''''''''''''''
Dim sqls As String
sqls = "SELECT data.tid, data.tname, data.hessas1 , data.rep1, data.hessas2 , data.rep2, data.dbirth, data.dmoahel, data.dtaeen, data.destlam, data.dwazefa, data.code, data.address, data.phone, data.mobile, data.drem , data.agrwazefy, wazefa.wazefaname, moahel.moahelname, groups.grname, degree.degreename FROM (((data INNER JOIN wazefa ON data.wazefaid = wazefa.wazefaid) INNER JOIN moahel ON data.moahelid = moahel.moahelid) INNER JOIN groups ON data.grid = groups.grid) INNER JOIN degree ON data.degreeid = degree.degreeid where tid=" & Val(Label4.Text) & ""
cmd3.CommandText = sqls
Dim dr3 As OleDbDataReader
'ds = New DataSet
'Dim da As New OleDbDataAdapter
'da.SelectCommand = cmd3
'da.Fill(ds, "data")
dr3 = cmd3.ExecuteReader
Dim dt As New DataTable
If dr3.HasRows Then
dt.Load(dr3)
End If
Dim cmd1 As New OleDbCommand
cmd1.Connection = objconn
cmd1.CommandType = CommandType.Text
cmd1.CommandText = " SELECT moderia_name,edara_name,school_name,school_poss,poss1,poss2,school_saf ,school_pic from school"
Dim dr1 As OleDbDataReader
dr1 = cmd1.ExecuteReader
dr1.Read()
Dim rpt As New CrystalReport1
Dim t1, t2, t3, t4, t5 As TextObject
t1 = rpt.Section2.ReportObjects("Text2")
t2 = rpt.Section2.ReportObjects("Text3")
t3 = rpt.Section2.ReportObjects("Text4")
t4 = rpt.Section4.ReportObjects("Text13")
t5 = rpt.Section4.ReportObjects("Text15")
t1.Text = dr1.Item("moderia_name")
t2.Text = dr1.Item("edara_name")
t3.Text = dr1.Item("school_name")
t4.Text = dr1.Item("poss1")
t5.Text = dr1.Item("school_poss")
t6.Text = dr1.Item("school_pic")
rpt.SetDataSource(dt)
Form10.CrystalReportViewer1.ReportSource = rpt
'rpt.SetParameterValue(0, ttt)
Form10.CrystalReportViewer1.Zoom(100%)
Dim cmd3 As New OleDbCommand
cmd3.Connection = objconn
cmd3.CommandType = CommandType.Text
''''''''''''''''''''''''
Dim sqls As String
sqls = "SELECT data.tid, data.tname, data.hessas1 , data.rep1, data.hessas2 , data.rep2, data.dbirth, data.dmoahel, data.dtaeen, data.destlam, data.dwazefa, data.code, data.address, data.phone, data.mobile, data.drem , data.agrwazefy, wazefa.wazefaname, moahel.moahelname, groups.grname, degree.degreename FROM (((data INNER JOIN wazefa ON data.wazefaid = wazefa.wazefaid) INNER JOIN moahel ON data.moahelid = moahel.moahelid) INNER JOIN groups ON data.grid = groups.grid) INNER JOIN degree ON data.degreeid = degree.degreeid where tid=" & Val(Label4.Text) & ""
cmd3.CommandText = sqls
Dim dr3 As OleDbDataReader
'ds = New DataSet
'Dim da As New OleDbDataAdapter
'da.SelectCommand = cmd3
'da.Fill(ds, "data")
dr3 = cmd3.ExecuteReader
Dim dt As New DataTable
If dr3.HasRows Then
dt.Load(dr3)
End If
Dim cmd1 As New OleDbCommand
cmd1.Connection = objconn
cmd1.CommandType = CommandType.Text
cmd1.CommandText = " SELECT moderia_name,edara_name,school_name,school_poss,poss1,poss2,school_saf ,school_pic from school"
Dim dr1 As OleDbDataReader
dr1 = cmd1.ExecuteReader
dr1.Read()
Dim rpt As New CrystalReport1
Dim t1, t2, t3, t4, t5 As TextObject
t1 = rpt.Section2.ReportObjects("Text2")
t2 = rpt.Section2.ReportObjects("Text3")
t3 = rpt.Section2.ReportObjects("Text4")
t4 = rpt.Section4.ReportObjects("Text13")
t5 = rpt.Section4.ReportObjects("Text15")
t1.Text = dr1.Item("moderia_name")
t2.Text = dr1.Item("edara_name")
t3.Text = dr1.Item("school_name")
t4.Text = dr1.Item("poss1")
t5.Text = dr1.Item("school_poss")
t6.Text = dr1.Item("school_pic")
rpt.SetDataSource(dt)
Form10.CrystalReportViewer1.ReportSource = rpt
'rpt.SetParameterValue(0, ttt)
Form10.CrystalReportViewer1.Zoom(100%)

