简体   繁体   English

使用两个表生成水晶报表

[英]Crystal report generation using two tables

I am using C#.net 2010, I want to create invoice using two tables. 我正在使用C#.net 2010,我想使用两个表创建发票。 One table Order consist of things ordered by customer like category, qty, rate, Total amount, and another table Details consist of final amount paid details like Vat, Final total. 一个表Order由客户Order组成,例如类别,数量,费率,总金额,而另一个表Details由最终付款的详细Details组成,例如增值税,最终总计。 I have created one data set consist of one data table using following query: 我使用以下查询创建了一个由一个数据表组成的数据集:

SELECT Order*,Details* FROM (Order INNER JOIN Details ON Order.ID = Details.ID)
WHERE(Order.ID = ?)`

It's showing "Details" table records multiple times instead of one time, as it consist of unique record of each order. 它显示“明细”表记录多次而不是一次,因为它由每个订单的唯一记录组成。 Please help me to solve this issue. 请帮我解决这个问题。

I got its solution, have created this using simple report ie using .rdlc file from add new item on solution explorer, then I add dataset, created using query mentioned in my question, then I created two table for Order table & Details table in .rdlc file from its toolbox menu, after that I removed grouping of Details table by selecting its row, right click on it and selcted Row Group-> Delete Group. 我得到了它的解决方案,使用简单的报表创建了该解决方案,即使用.rdlc文件从解决方案资源管理器中添加新项目,然后添加数据集,使用问题中提到的查询创建,然后在中为Order表和Details表创建了两个表。从其工具箱菜单中的rdlc文件删除之后,我通过选择其行删除了Details表的分组,右键单击它,然后选择了Row Group-> Delete Group。 Finally, attached this .rdlc file to Reportviewer. 最后,将此.rdlc文件附加到Reportviewer。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM