如何创建包含多个talbes的水晶报告?

问题描述:

我正在尝试使用多个表创建销售发票。这是我的存储过程。



更改程序CreateInvoice





@CustomerID nvarchar(50),

@JobOrderID nvarchar(50)





AS >
SELECT Invoice.JobOrderID,ProductOrders.StyleNumber,ProductOrders.Sizes,ProductOrders.OrderedQuantity,ProductOrders.QuantityDelivered,ProductOrders.UnitCost,

ProductOrders.SubTotal,Customer.BusinessName,CustomerAddress.StreetNumber, CustomerAddress.City,CustomerAddress.Province,CustomerAddress.ZipCode,

Invoice.CustomerID

FROM Invoice INNER JOIN

ProductOrders ON Invoice.JobOrderID = ProductOrders .JobOrderID INNER JOIN

客户ON Invoice.CustomerID = Customer.CustomerID INNER JOIN

CustomerAddress ON Invoice.CustomerID = CustomerAddr ess.CustomerID

WHERE(Invoice.JobOrderID = @JobOrderID)AND(Invoice.CustomerID = @CustomerID)AND(CustomerAddress.Type = N'Shipping')

RETURN

I'm trying to create a sales invoice with multiple table. Here is my stored procedure.

ALTER PROCEDURE CreateInvoice

(
@CustomerID nvarchar(50),
@JobOrderID nvarchar(50)
)

AS
SELECT Invoice.JobOrderID, ProductOrders.StyleNumber, ProductOrders.Sizes, ProductOrders.OrderedQuantity, ProductOrders.QuantityDelivered, ProductOrders.UnitCost,
ProductOrders.SubTotal, Customer.BusinessName, CustomerAddress.StreetNumber, CustomerAddress.City, CustomerAddress.Province, CustomerAddress.ZipCode,
Invoice.CustomerID
FROM Invoice INNER JOIN
ProductOrders ON Invoice.JobOrderID = ProductOrders.JobOrderID INNER JOIN
Customer ON Invoice.CustomerID = Customer.CustomerID INNER JOIN
CustomerAddress ON Invoice.CustomerID = CustomerAddress.CustomerID
WHERE (Invoice.JobOrderID = @JobOrderID) AND (Invoice.CustomerID = @CustomerID) AND (CustomerAddress.Type = N'Shipping')
RETURN

以下链接将帮助您在水晶报告中使用存储过程



http://www.pdssoftware.com/newsletter/mar07/page6.htm [ ^ ]





http://dotnetmentors.com/报告/ crystal-report-with-stored-procedure-parameter-and-visual-studio.aspx [ ^ ]



http://www.neodynamic.com/ND/FaqsTipsTricks.aspx?tabid= 66& prodid = 3& sid = 70 [ ^ ]





您也可以在google上搜索。
Following links will help you to use stored procedure in your crystal report

http://www.pdssoftware.com/newsletter/mar07/page6.htm[^]


http://dotnetmentors.com/reporting/crystal-report-with-stored-procedure-parameter-and-visual-studio.aspx[^]

http://www.neodynamic.com/ND/FaqsTipsTricks.aspx?tabid=66&prodid=3&sid=70[^]


Also you can search on google .