带有选择查询的子报表 [英] subreport with select query‏

查看:58
本文介绍了带有选择查询的子报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要这方面的帮助

我正在尝试使用选择查询将记录分配给具有两个未链接表的主报表和子报表

这是我的代码



i need help on this

i''m trying to use a select query to assign records to both a main report and a subreport with two unlinked tables

this is my code

comm.Connection = conn
comm.CommandText = "Select * from ReceievedStock where month(DateReceived) = '" & dd1 & "' and Year(DateReceived) = '" & dd2 & "'"
da.SelectCommand = comm

da.Fill(das, "ReceievedStock")
'da.Dispose()

comm1.Connection = conn
comm1.CommandText = "Select * from IssuedStock where month(DateIssued) = '" & dd1 & "' and Year(DateIssued) = '" & dd2 & "'"
da.SelectCommand = comm1

da.Fill(das, "IssuedStock")



但是,当我显示报告时,记录会成倍出现(每组记录都会重复)

在这方面需要帮助.谢谢您



But when i display the report, the record comes in double(each set of record get duplicated)

Need help on this.. Thank you

推荐答案

kwamebounty,

1.首先,设置主报告和子报告"链接(右键单击子报告和
选择子报告"链接,链接主报告ID和子报告ID)
2.设置报告数据源
report.setdatasource(das.tables(0))
report.subreports(0).setdatasource(das.tables(1))

让我知道它是否无效.

谢谢
Hi kwamebounty,

1. First u set the Main report and sub report link(right click the sub reoport and
select Sub Report link , link the master report id and sub report id)
2. Set the report data source
report.setdatasource(das.tables(0))
report.subreports(0).setdatasource(das.tables(1))

Let me know if it is not worked.

Thanks


这篇关于带有选择查询的子报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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