用户定义函数的水晶报表源困难
我有以下查询:
SELECT *
FROM tbl_Muffins
WHERE OvenLoadId IN (
SELECT OvenLoadId
FROM tbl_Muffins
WHERE OrderId = ?
GROUP BY OvenLoadId
)
ORDER BY OvenLoadId, LocationNumber ASC
查询的想法是我想指定一个 OrderId,并且我想要所有包含该订单中的项目的烤箱负载,以及这些负载中的所有其他项目,即使它们可能是来自其他订单。
该查询按预期工作,但我无法将其用于我为其编写的水晶报表。
我已将此查询放入用户定义函数中,但是我无法使用对该函数的调用作为 Crystal Report 中的表源。我正在使用 Visual Studio 2003(我知道它很旧,客户端拒绝升级)。
我做错了什么?
谢谢,
jnsohnumr
I have the following Query:
SELECT *
FROM tbl_Muffins
WHERE OvenLoadId IN (
SELECT OvenLoadId
FROM tbl_Muffins
WHERE OrderId = ?
GROUP BY OvenLoadId
)
ORDER BY OvenLoadId, LocationNumber ASC
The idea of the query is that I want to specify an OrderId, and I want all Oven Loads that have items from that order in them, as well as ALL OTHER ITEMS in those loads, even though they could be from other orders.
The query works as expected, but I'm not able to use it for my Crystal Report I've written it for.
I have put this query into a User Defined Function, however I'm unable to use a call to that function as a table source in my Crystal Report. I am using Visual Studio 2003 (I know it is old, the client refuses to upgrade).
What am I doing wrong?
Thanks,
jnsohnumr
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 Crystal Reports 版本 9 开始,可以使用 Crystal 的 “添加命令” 功能。
这里有关于向命令查询添加参数的描述< /a>.
From version 9 of Crystal Reports onwards, it became possible to report from custom queries using Crystal's "Add Command" functionality.
There is a description of adding a parameter to a command query here.