Click here to Skip to main content
15,904,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:

VB
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()
Posted
Updated 17-May-12 17:49pm
v2
Comments
ShaikhM 21-May-12 0:44am    
may be you have include a join or something and relate both the datatables. I am not sure. What else have you tried.

And if you seriously want to use crystal report, then why dont you create one instead of doing this dynamic thing. And then pass your data to the report

1 solution

http://stackoverflow.com/questions/15172105/crystal-report-is-not-showing-data[^]
you can check this link this will solve your problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900