Hi everyone,
What i have created is a dataset1 with two data tables.
Datatable1 with columns of:
emp_id
emp_name
emp_age
Datatable2 with column of:
emp_id
log_in
log_out
I use the code below to load data to each dataset1 tables
I have also and use that dataset in crystal reporst in ADO.Net Objects
When i use only 1 table "Datatable1" to display in crystal reports it works and displays the fields and date is appearing on the reports.
However my problem is this. when i load those data in two datatables
and load both of them in one crystal report no data where shown i tried to use crystal report relationship but no success at all
What am i expecting is to display emp_id + emp_name + log_in and log_out using to tables and its relationship by emp_id but it doesn't work.
can someone tell me where did i go wrong? Thanks
here is my code:
Dim tbl1 As DataSet1.DataTable1Row
tbl1 = DataSet1.DataTable1.NewDataTable1Row()
tbl1.emp_id = "1"
tbl1.emp_name = "josh"
tbl1.emp_age = "19"
DataSet1.DataTable1.Rows.Add(tbl1)
Dim tbl2 As DataSet1.DataTable2Row
tbl2 = DataSet1.DataTable2.NewDataTable2Row()
tbl2.emp_id = "1"
tbl2.log_in = "time"
tbl2.log_out = "time"
DataSet1.DataTable2.Rows.Add(tbl2)
Dim objRpt As New CrystalReport1
objRpt.SetDataSource(DataSet1.Tables(0))
CrystalReportViewer1.ReportSource = objRpt
CrystalReportViewer1.Refresh()