ActiveReports 9 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Section Report Walkthroughs > Layout > Columnar Reports |
ActiveReports supports newspaper column layouts in both the Detail and Group sections. You can render the columns either horizontally or vertically in the section with options to break the column on the Group section (i.e. start a new column on the change of a group).
There is also a Boolean ColumnGroupKeepTogether property on the GroupHeader. When set to True, the ColumnGroupKeepTogether property attempts to prevent a group from splitting across columns. If a group cannot fit in the current column, it tries the next. If the group is too large for a single column, the property is ignored.
Note: The ColumnGroupKeepTogether property only works when the GroupHeader's GroupKeepTogether property is set to All. |
This walkthrough illustrates how to create a simple report using columns, and is split up into the following activities:
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is located at [User Documents folder]\ComponentOne Samples\ActiveReports 9\Data\NWIND.mdb. |
When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.
To add an ActiveReport to the Visual Studio project
See Adding an ActiveReport to a Project for information on adding different report layouts.
To connect the report to a data source
SQL Query |
Copy Code
|
---|---|
SELECT Country, CompanyName, ContactName, Phone FROM Customers ORDER BY Country |
To create a layout for the report
Property Name | Property Value |
---|---|
Name | ghCountry |
BackColor | Gold |
DataField | Country |
ColumnGroupKeepTogether | True |
GroupKeepTogether | All |
Property Name | Property Value |
---|---|
Location | 0, 0 in |
Size | 3.25, 0.2 in |
Alignment | Center |
FontSize | 12 |
Font Bold | True |
Property Name | Property Value |
---|---|
Location | 0, 0 in |
Size | 6.5, 0.25 in |
Alignment | Center |
FontSize | 14 |
Text | Customer Telephone List by Country |
Property Name | Property Value |
---|---|
CanShrink | True |
ColumnCount | 2 |
TextBox1
Property Name | Property Value |
---|---|
Field | CompanyName |
Location | 0, 0 in |
Size | 1.15, 0.2 in |
Font Size | 8pt |
TextBox2
Property Name | Property Value |
---|---|
Field | ContactName |
Location | 1.15, 0 in |
Size | 1.15, 0.2 in |
Font Size | 8pt |
TextBox3
Property Name | Property Value |
---|---|
Field | Phone |
Location | 2.3, 0 in |
Size | 0.95, 0.2 in |
Font Size | 8pt |
To view the report
OR