ActiveReports Developer 7
Columnar Layout Reports (CPL)
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > Samples and Walkthroughs > Walkthroughs > Page Report Walkthroughs > Columnar Layout Reports (CPL)

Glossary Item Box

In CPL reports, you can create a columnar report layout by using the Columns property of the report. This walkthrough illustrates how to create a CPL report using columns, and is split up into the following activities:

Note: This walkthrough uses the CustomerMailingList table from the Reels database. By default, in ActiveReports, the Reels.mdb file is located in the [User Documents folder]\ComponentOne Samples\ActiveReports Developer 7\Data folder.

When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.

Design Time Layout


Runtime Layout


ShowTo add an ActiveReport to the Visual Studio project

  1. Create a new Visual Studio project.
  2. From the Project menu, select Add New Item.
  3. In the Add New Item dialog that appears, select ActiveReports 7 Page Report and in the Name field, rename the file as rptCPLColumnLayout.
  4. Click the Add button to open a new fixed page report in the designer.
  5. From the Report menu, select Convert to CPL Report.

See Adding an ActiveReport to a Project for information on adding different report layouts.

ShowTo connect the report to a data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the Add button.
  2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like ReportData.
  3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting to a data source.

ShowTo add a dataset

  1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data Set from the Add button.
  2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as CustomerList. This name appears as a child node to the data source icon in the Report Explorer.
  3. On the Query page of this dialog, in the Query field enter the following SQL query.
    SQL Query Copy Code
    SELECT TOP 100 * FROM CustomerMailingList
    UNION
    SELECT TOP 100 * FROM CustomerMailingList WHERE Country = "USA"
    ORDER BY 8 DESC                                 
    
  4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.

  5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.

ShowTo create a column layout for the report

  1. In the Report Explorer, select Body and set the following properties in the properties window.
    Property Name Property Value
    Columns 2
    ColumnSpacing 0.25in
    Size 2.625in, 1in
  2. In the Visual Studio toolbox, go to the ActiveReports 7 Page Report tab and drag the List data region onto the design surface.
  3. In the Properties Window, set the following properties for the List.
    Property Name Property Value
    DataSetName CustomerList
    Size 2.5in, 1in
  4. In the Visual Studio toolbox, go to the ActiveReports 7 Page Report tab and drag three TextBox controls onto the List data region added above.
  5. In the Properties Window, set the following properties for TextBox1.
    Property Name Property Value
    Location 0in, 0in
    Size 2.5in, 0.25in
    DataElementName FirstName
    Name FirstName
    Value =Fields!FirstName.Value & IIF( Fields!MiddleInitial.Value Is Nothing, "", " " & Fields!MiddleInitial.Value ) & " " & Fields!LastName.Value
    CanGrow False
  6. In the Properties Window, set the following properties for TextBox2.
    Property Name Property Value
    Location 0in, 0.25in
    Size 2.5in, 0.25in
    DataElementName CustomerAddress1
    Name CustomerAddress1
    Value =Fields!Address1.Value & IIF( Fields!Address2.Value is Nothing, "", vbCrLf & Fields!Address2.Value )
    CanGrow False
    CanShrink True
  7. In the Properties window, set the following properties for TextBox3.
    Property Name Property Value
    Location 0in, 0.50in
    Size 2.5in, 0.25in
    DataElementName CustomerCity
    Name CustomerCity
    Value =Fields!City.Value & ", " & Fields!Region.Value & "  " & Fields!PostalCode.Value & "   " & IIf( Fields!Country.Value = "USA", "", Fields!Country.Value )
    CanGrow False

ShowTo view the report

  • Click the preview tab to view the report at design time.

OR

If you want to create a similar layout in FPL reports, see Overflow Data in a Single Page.

See Also

©2014. ComponentOne, a division of GrapeCity. All rights reserved.