如何在Crystal报表中合并多个表数据. [英] how to combined multiple table data in crystal report.
本文介绍了如何在Crystal报表中合并多个表数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是我知道如何从单个表中检索数据并将其绑定到Crystal Report,并使用Crystal Report Viewer,我可以通过直接单击表单上的按钮直接打印它.
但是我有一个问题,那就是如何从多个表中检索数据并使用它..
对于单个表,代码如下:
按下按钮时发生的事件:
my problem is i know how to retrive a data from single table and bind it to crystal report and using crystal report viewer i can directly print it using directly button clicking on my form
but i have problem that is how can i retrive a data from more than one table and used it..
for single table the code is as follow:
On Button click event:
Call openconnection()
str = "SELECT * from New_Case_Id_Master where CaseId=" & s_no & ""
da = New SqlDataAdapter(str, cn)
ds.Clear()
da.Fill(ds, "New_Case_Id_Master")
'MsgBox(ds.Tables("New_Case_Id_Master").Rows.Count)
cn.Close()
'print directly using button click
Dim objRpt As New CrystalReport_for_FrontDesk
objRpt.SetDataSource(ds.Tables("New_Case_Id_Master"))
CrystalReportViewer1.ReportSource = objRpt
CrystalReportViewer1.PrintReport()
CrystalReportViewer1.PrintReport()
CrystalReportViewer1.Refresh()
我的问题是如何修改此代码以从多个表中检索数据..
my question is how can i modify this code for retrieving data from multiple tables..
推荐答案
选中此
http://social.msdn.microsoft.com/Forums/eu/vscrystalreports/thread/feb26ef7-886e-4a4d-aeb5-9e8d6f7cfa14 [
check this
http://social.msdn.microsoft.com/Forums/eu/vscrystalreports/thread/feb26ef7-886e-4a4d-aeb5-9e8d6f7cfa14[^]
这篇关于如何在Crystal报表中合并多个表数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文