ActiveReports for .NET 3 Online Help Request technical support
Walkthrough: Page Numbering in the Page Footer
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Standard Edition Walkthroughs > Basic > Page Numbering Walkthroughs > Walkthrough: Page Numbering in the Page Footer

Glossary Item Box

With ActiveReports, page numbering can be easily applied to a report using the PageFooter section.

This walkthrough illustrates the basics of setting up page numbering in the PageFooter section.

The walkthrough is split up into the following activities:

To complete the walkthrough, you must have access to the Northwind database.
A copy is located at C:\Program Files\Data Dynamics\ActiveReports for .NET 3.0\Data\NWIND.MDB.

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

Adding an ActiveReport to a Visual Studio project

To add an ActiveReport to your project

  1. From the Project menu, select Add New Item.
  2. Select ActiveReports 3.0 File and rename it rptNumberPF.
  3. Change the name of the report and click Open.
  4. The ActiveReports design surface is displayed.

Connecting the data source to a database

To connect the data source to a database

  1. Click on the gray report DataSource icon in the Detail section to open the report DataSource dialog.
  2. Select the "OLE DB" tab.
  3. Click the Build button.
  4. Select "Microsoft Jet 4.0 OLE DB Provider" and click Next.
  5. Click the ellipsis button to browse for the access path to the NorthWind database. Click Open once you have selected the appropriate access path.
  6. Click OK to continue.
  7. In the Query field, type "Select * from products order by categoryID".
  8. Click OK to return to the report design surface.

Adding controls to contain data

To add controls to contain data

  1. Add a GroupHeader/Footer section to rptNumberPF by right-clicking the design surface of the report and selecting Insert > Group Header/Footer.
  2. Make the following changes to the group header:
    • Change the name to ghProducts
    • Change the BackColor property to Gainsboro
    • Change the DataField property to CategoryID
    • Change the GroupKeepTogether property to All
    • Change the KeepTogether property to True
  3. Add the following controls to the GroupHeader section:

    Control Name Text Location
    Label lblProductID Product ID 0, 0
    Label lblProductName Product Name 1.1875, 0
    Label lblUnitsInStock Units In Stock 3, 0
    Label lblUnitPrice Unit Price 4.375, 0

  4. In the Report Explorer, expand the Fields node, then the Bound node. Drag the following fields onto the detail section and set the following properties of each textbox as indicated.  

    Field Text Miscellaneous Location
    ProductID Product ID NA 0, 0
    ProductName Product Name NA 1.1875, 0
    UnitsInStock Units In Stock NA 3, 0
    UnitPrice Unit Price OutputFormat = Currency 4.375, 0

  5. Add the following controls to the PageFooter section:

    Control Name Miscellaneous Location
    ReportInfo reportInfo1

    FormatString=Page{PageNumber} of {PageCount}

    SummaryGroup=ghProducts

    SummaryRunning = Group

    0, 0

Viewing the report

To view the report

  1. Add the ActiveReports viewer control to a Windows Form.
  2. Add the code needed to set the viewer document equal to the report document. See Using the ActiveReports Windows Form Viewer for help.
You can quickly view your report at design time by clicking the Preview tab at the bottom of the designer.

See Also

©2009. All Rights Reserved.