All docs
V20.1
20.2 (EAP/Beta)
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Create a Report with PDF Content

  • 2 minutes to read

This tutorial describes how to use the XRPdfContent control to create a report similar to the Report Merging with PDF demo (the DevExpress Demo Center should be installed).

pdfcontentdemo-result

TIP

The following topics describe different ways to create a report that merges different documents:

Create a Report Layout

Create a report that should include PDF content.

initial-report

In this tutorial, the report shows an order. A Detail Report band is bound to the data source's Orders query to display the order details and customer information. An inner Detail Report band is bound to the OrderItems query to list products included in an order.

The report uses the sample devav.sqlite3 database from the DevExpress Demo Center.

initial-report

Add PDF Content

Add a PDF document for each product listed in an order.

  1. Add a Detail Report band at the location where you want to place PDF content. As PDF content is rendered on separate pages, the report from this tutorial includes this band at the bottom. Bind the new band to the same data member as in the Create a Report Layout section above (OrderItems in this example).

    add-detail-report-for-pdf

  2. Drop the XRPdfContent item from the Toolbox onto the added band.

    drop-xrpdfcontent

  3. Bind the dropped control to the source of PDF data. Expand the control's smart tag and click the Expression property's ellipsis button below the Source property. In the invoked Expression Editor, select the data source field that stores PDF documents and click OK.

    bind-to-pdf-source

    TIP

    Other options are available to bind the XRPdfContent control to PDF data:

    • Bind to a PDF file
      Specify the file's path or URL in the control's SourceUrl property. The specified file should be available when a report is generated.
    • Save the PDF content in the report
      Click the Source property's ellipsis button and select the file from which to load the content.

The report is ready and can be viewed in the Preview tab. Each PDF document is printed on a separate page and uses its own page settings.

pdfcontentdemo-result