How to use SubReport in XtraReport?

Prince Jea picture Prince Jea · Jan 23, 2012 · Viewed 10.8k times · Source

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

Answer

Willem picture Willem · Jan 23, 2012

Have a look here.

Creating a master-detail report with the use of subreports requires the following actions.

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.

If you want to use your own DataSet have a look here.