如何在XtraReport中使用SubReport? [英] How to use SubReport in XtraReport?
问题描述
我有一份主要报告(详细报告)
I have a main Report which consist of (Detail Report)
Transaction #
Amount Due
PaymentType
Money Tendered
我还有另一个报告,其中包括订购的项目(项目报告)
and I have another report which consist of items ordered (Items Report)
Transaction #
ItemName
Quantity
Amount Due
我的问题是如何将项目报告与细节报告相结合
我所期望的格式是
My question is how to combine the Items Report to the Detail Report My Desired format is
Transaction # AmountDue PaymentType MoneyTendered
[Detail Report]==> Link through ID
推荐答案
查看这里。
创建一个主详细报告使用子报表需要执行以下操作。
Creating a master-detail report with the use of subreports requires the following actions.
首先,需要创建两个报表类(主数据和详细信息)并绑定到每个报表。请注意,两个报表的数据源应包含具有相同键的数据列,可以从主报表传递到详细报表。
对于详细报告,有必要创建一个公共参数,以在详细报告之外进行初始化。该参数应用于根据包含密钥的列过滤与详细报告绑定的数据源。
然后,详细报告应通过XRSubreport控件嵌入到主报表中。此外,还需要处理其XRControl.BeforePrint事件,并将主键值传递给详细报告。
在运行时在Web上预览,打印,导出或发布报表。
First, it is necessary to create two report classes (master and detail) and bind to data each of them. Note that the datasources of both reports should contain a data column with the same key, which can be passed from a master report to a detail report. For the detail report, it is necessary to create a public parameter to be initialized outside the detail report. This parameter should be used to filter a datasource bound to the detail report against the column that contains a key. Then, the detail report should be embedded into a master report via the XRSubreport control. In addition, it is required to handle its XRControl.BeforePrint event, and pass a key value from the master to the detail report. Preview, print, export or publish a report on the Web at runtime.
如果要使用自己的 DataSet
看看 here 。
这篇关于如何在XtraReport中使用SubReport?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!