在Crystal报表中加载表时发生问题 [英] Problem occured to load table in crystal report
本文介绍了在Crystal报表中加载表时发生问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的报告中,我想显示两个不同表中的值,我该如何使用编码设置数据源以在运行时进行报告
例如,我给出以下内容,但它不起作用
它是显示第二个表中的所有字段,我想一次显示一个表怎么做
In my report i want to display the values from two different tables, how can i set the datasource using coding to report at runtime
For example i give the following but it is not working
it is display all the fields in second table i want to display one table at a time how to do it
Dim rrview As New reportviewer
Dim ProDset1 As New DataSet
Dim sqlda As New SqlDataAdapter("select * from PL where fromdate='" & Format(fromdate.Value, "MM-dd-yyyy") & "' and todate='" & Format(todate.Value, "MM-dd-yyyy") & "'", con)
Dim sqlda1 As New SqlDataAdapter("select * from Expenses where Date>= '" & Format(fromdate.Value, "MM-dd-yyyy") & "' and Date<= '" & Format(todate.Value, "MM-dd-yyyy") & "'", con)
sqlda.Fill(ProDset1, "T1")
sqlda1.Fill(ProDset1, "T2")
Dim RptProstmt As New Crystal10
RptProstmt.SetDataSource(ProDset1)
rrview.viewer1.ReportSource = RptProstmt
rrview.viewer1.DisplayGroupTree = False
rrview.MdiParent = MyBase.MdiParent
rrview.Show()
推荐答案
只需分配Table
而不是DataSet
.
Just assign theTable
instead ofDataSet
.
RptProstmt.SetDataSource(ProDset1.Tables(0))
编辑
来自多个表的VB.NET Crystal报表 [
EDIT
VB.NET Crystal Reports from multiple tables[^]
这篇关于在Crystal报表中加载表时发生问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文