在Crystal Reports中链接参数 [英] Linking parameters in Crystal Reports
问题描述
我有一个项目,该项目的一部分在Crystal Reports中
仅使用Crystal Reports和Sql命令(从数据库检索数据)就不需要使用VB/VB.Net代码.
我有2张桌子:
PurchaseOrder
-PurcaseOrderID
PurcaseOrderLines
-PurchaseOrderID
-PurcaseOrderLineID
-PartID
-RevisionID
我想让用户选择输入OrderID的数据,然后将此参数与PartID链接(从表数据库中检索数据)
像:
Hi,
I have a project and part of this project is in Crystal Reports
It is not required to use VB/VB.Net code just Crystal Reports and Sql commands (retrieving data from the database)
And I have 2 Tables:
PurchaseOrder
- PurcaseOrderID
PurcaseOrderLines
-PurchaseOrderID
-PurcaseOrderLineID
-PartID
-RevisionID
I want to give the user the option to enter the data for OrderID and then to link this parameter with PartID (retrieve the data from the table-database)
Something like :
SELECT PartID
FROM PurchaseOrdersLines
WHERE EXISTS
(select PartID,PartRevisionID
from PurchaseOrderLines
where PurhcaseOrderLines.PurchaseOrderID = PurchaseOrders.PurchaseOrderID
And PurcaseOrderLines. PurchaseOrderID= {?OrderID}
Or
Select PartID
From PurchaseOrdersLines INNER JOIN PurchaseOrders ON PurchaseOrders.[PurchaseOrderID] = PurchaseOrdersLines.[PurchaseOrderID]
Where PurchaseOrders.[PurchaseOrderID]={?@OrderID}
预先谢谢您.
Thank you in advance.
推荐答案
在Crystal Reports中,您可以选择该特定报告中使用的表并将其链接.
在这种情况下,请使用PurchaseOrderID. (根据您的查询).然后使用与PurchaseOrderID对应的类型创建参数.
在Crystal Reports菜单中,您可以修改"报表的where子句,并像这样设置子句PurchaseOrders.[PurchaseOrderID]={?@OrderID}
如果这对您来说是新事物,我建议您阅读该主题(最好是买一本好书).
In Crystal Reports you can select the tables used in that specific report and link them.
In this case use the PurchaseOrderID. (based on your query). Then create your parameter with a type corresponding to PurchaseOrderID.
In the menu of Crystal Reports you can ''modify'' the where clause for the report and set the clause like thisPurchaseOrders.[PurchaseOrderID]={?@OrderID}
If this is all new to you I suggest reading up on the topic (best is to buy a good book).
这篇关于在Crystal Reports中链接参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!