ActiveReports 10
Columnar Layout Reports (RDL)
ActiveReports 10 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Page Report/RDL Report Walkthroughs > Layout > Columnar Layout Reports (RDL)

In RDL report, you can create a columnar report layout by using the Columns property of the report. This walkthrough illustrates how to create a RDL 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]\GrapeCity Samples\ActiveReports 10\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

To 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 10 RDL Report and in the Name field, rename the file as rptRDLColumnLayout.
  4. Click the Add button to open a new RDL report in the designer.

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

To 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.

To 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.

To 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 10 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 10 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

To view the report

OR

If you want to create a similar layout in Page report, see Overflow Data in a Single Page.
See Also