ActiveReports 6 Online Help
Overlaying Reports (Letterhead)
Show AllShow All
Hide AllHide All

ActiveReports allows you to overlay static report formats over data reports. This walkthrough illustrates how to overlay an ActiveReport with a static letterhead report.

This walkthrough is split up into the following activities:

Tip: For basic steps like adding a report to a Visual Studio project and viewing a report, please see the Basic Data Bound Reports walkthrough.

To complete the walkthrough, you must have access to the Northwind database.
A copy is located at C:\Program Files\GrapeCity\ActiveReports 6\Data\NWIND.MDB (on a 64-bit Windows operating system, a copy is located in C:\Program Files (x86)\GrapeCity\ActiveReports 6\Data\NWIND.MDB).

When you have completed this walkthrough, you will have a report that looks similar to the following.

To connect rptData to a data source

  1. Add two reports to a Visual Studio project, naming them rptLetterhead and rptData.
  2. Click the gray report DataSource icon on the Detail section band to open the Report Data Source dialog.
  3. On the OLE DB tab, next to Connection String, click the Build button.
  4. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the Next button.
  5. Click the ellipsis (...) button to browse to the Northwind database. Click Open once you have selected the appropriate access path.
  6. Click OK to close the window and fill in the Connection String field.
  7. In the Query field, enter the following SQL query
    SQL Query
    Copy Code
    SELECT * FROM Customers ORDER BY Country
  8. Click OK to save the data source and return to the report design surface.

To add controls to rptData

  1. Select the PageHeader section, and in the Properties Window, set the Height property to 0.65. (This will match the height of the page header in the template.)
  2. Right-click the report and select Insert > GroupHeader/Footer to add group header and group footer sections.
  3. Make the following changes to the group header:
    • Change the Name property to ghCustomers
    • Change the BackColor property to MediumSlateBlue
    • Change the CanShrink property to True
    • Change the DataField property to Country
    • Change the GroupKeepTogether property to FirstDetail
    • Change the KeepTogether property to True
  4. Add the following controls to ghCustomers with properties set as indicated:

    Group header labels

  5. Make the following changes to the detail section:
    • Change the BackColor property to LightGray
    • Change the CanShrink property to True
  6. In the Report Explorer, expand the Fields node, then the Bound node. Drag the following fields onto the detail section and set the properties of each textbox as indicated.

    Detail fields

  7. Change the group footer's Height property to 0.

To add static controls to rptLetterhead

  1. Make the following changes to the page header:
    • Change the BackColor property to DarkSlateBlue
    • Change the Height property to 0.65
  2. Add the following controls to the page header with properties set as indicated:

    Page header labels

  3. Make the following changes to the page footer:
    • Change the BackColor property to DarkSlateBlue
  4. Add a label with the following properties to the page footer:

    Page footer label

Adding code to overlay the data report pages with the letterhead report

To write the code in Visual Basic.NET

To write the code in C#

See Also

How To