This CrossSectionControls sample displays the invoice report of a company in detail. This sample uses the CrossSectionBox and CrossSectionLine controls to demonstrate the lines and display the Invoice report in a tabular form. It includes a ViewerForm with three tabs, three Viewer controls and an Invoice report to highlight several report features. Run the project and click the tab to see these features in action.
Visual Basic.NET
<User Folder>\Documents\GrapeCity Samples\ActiveReports 13\API\Section\CrossSectionControls\VB.NET
C#
<User Folder>\Documents\GrapeCity Samples\ActiveReports 13\API\Section\CrossSectionControls\C#
When you run this sample, a form with three different tab options and each tab option displaying a report in a Viewer control is displayed. Click any tab option at the bottom of the form to display the selected tab feature applied to the report in a Viewer control. Select from the following tab options.
Cross Section Controls
Draws table style gridlines easily through multiple sections without any gap.
Detail RepeatToFill
The Detail RepeatToFill tab has the RepeatToFill property set to True. This ensures that the formatting (alternating purple and white rows and CrossSection controls) fills space as needed to keep the same layout between pages.
GroupFooter PrintAtBottom
The GroupFooter section has the PrintAtBottom property set to True. This pulls the GroupFooter section to the bottom of the page, just above the PageFooter section.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents folder]\GrapeCity Samples\ActiveReports 13\Data\NWIND.mdb. If you are unable to access the data files in the sample, create the Data folder and place all the data files to this folder, or change the reference path to the data files within the folder according to your environment.
Two of the TextBox controls use a CalculatedField in the DataField property.
![]() |
Tip: In the Report Explorer, expand the Fields node, then Calculated to see all of the calculated fields. Select BillingAddress or ShippingAddress to take a look at the Formula used in the Properties window. |
The Line control is used below the column header labels to draw a horizontal line across the width of the report. (It is not visible at design time unless you make the Height of the GroupHeader section larger.) The DataField property of the customerGroupHeader section is set to the OrderID field, so that the section (followed by related details and GroupFooter) prints once per order.
Right-click the report and select View Code to see the code used in the customerGroupFooter Format event to calculate the value for the Grand Total TextBox, and to format it as currency.**
PageFooter section: The ReportInfo control uses a FormatString property value of Page {PageNumber} of {PageCount}, one of the preset values you can use for quick page numbering.