晶体报告中的2个数据集表 [英] 2 Dataset tables in a crystal reports

查看:71
本文介绍了晶体报告中的2个数据集表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我创建的是一个带有两个数据表的dataset1。



数据集1的列数为:

emp_id

emp_name

emp_age



Datatable2 with专栏:

emp_id

log_in

log_out



我使用的代码下面将数据加载到每个数据集1表

我也在ADO.Net对象中使用水晶reporst中的数据集



当我使用只有1个表Datatable1在水晶报表中显示它可以工作并显示字段和日期出现在报表上。





但是我的问题是这个。当我在两个数据表中加载这些数据

并在一个水晶报告中加载它们时没有数据显示我试图使用水晶报告关系但是没有成功



我期待的是显示emp_id + emp_name + log_in和log_out使用表格及其与emp_id的关系,但它不起作用。



有人能告诉我哪里出错了吗?谢谢



这是我的代码:



  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 作为 CrystalReport1
objRpt.SetDataSource(DataSet1.Tables( 0 ))
CrystalReportViewer1.ReportSource = objRpt
CrystalReportViewer1.Refresh()

解决方案

http://stackoverflow.com/questions/15172105/crystal-report-is-not-showing-data [ ^ ]

您可以查看此链接,这将解决您的问题。

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()

解决方案

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


这篇关于晶体报告中的2个数据集表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆