Skip to main content

Merge Reports: Use Data-Driven Page Sequence

  • 3 minutes to read

This topic describes how to combine a table report that uses the Portrait page orientation and a chart report that uses the Landscape page orientation. A sample combined report is available in the Report Merging demo.


Follow the steps below to create a combined report:

Create a Chart Report

  1. Create a chart report that shows all products in a category. The report is bound to thesample Northwind database‘s Products table. Set the report’s Landscape property to true to enable the Landscape page orientation.


  2. Add the CatID parameter to your chart report to specify which product category to build the chart for. Right-click Parameters in the Field List (Visual Studio Report Designer) and choose Add Parameter.


  3. Select the created parameter and set its Parameter.Name property to CatID, Parameter.Type to Int32 and Parameter.Visible to false.


  4. Click the report’s smart tag. Click the XtraReportBase.FilterString property’s ellipsis button. In the invoked FilterString Editor, construct an expression to compare the CategoryID data field to the CatID parameter. To access the parameter, click the icon on the right until it turns into a question mark.


  5. Rebuild your solution.


Create the Base Report

  1. Join the Northwind database’s Products and Categories tables in the Query Builder. Create a report bound to the resulting query, and arrange a layout like the one shown below:


  2. Right-click the base report’s Detail band and select the Insert Band / Group Footer item in the context menu.


  3. Drag an XRSubreport item from the Toolbox onto the added group footer band.


  4. Click the subreport control’s smart tag. In the Sub-Report Tasks window, set the Report Source parameter to the chart report’s location.


  5. Enable the GenerateOwnPages option to print the embedded report on separate pages and use its own page settings.


  6. Bind the chart report’s CatID parameter to the base report’s CategoryID data field. Click the subreport’s smart tag and select Edit Parameter Bindings in the invoked SubReport Tasks window.


  7. The Parameter Bindings Collection Editor is invoked. Click Add to add a new binding. In the binding properties list, specify the data field to bind to and the parameter name to bind.


  8. Switch to Preview mode to see the combined report.


Your base report’s Table of Contents and Document Map include bookmarks from the embedded report. Use the XRSubreport.BookmarkParent property to specify the nesting level for the embedded report’s bookmarks.

See Also