ActiveReports 9 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Section Report > Data > Bound Data |
The Bound Data sample demonstrates various ways to bind data in a section report.
When you run the sample, the Viewer control displays the form with seven tabs, each with a different data binding technique. Click to select a tab, and then click the Bind To button to create the report.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\BoundData\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\BoundData\C#
Runtime Features
The top panel of the MainForm comprises of seven tabs:
Bind to DataSet
Creates a DataSet from the sample database and binds it to a SectionReport object.
Bind to DataReader
Creates a DataReader from the sample database and binds it to a SectionReport object.
Bind to DataView
Creates a DataView from the sample database and binds it to a SectionReport object. This tab contains a ComboBox which lets you choose the company name from the NWind database.
Bind to DataTable
Creates a DataTable from the sample database and binds it to a SectionReport object.
Bind to SQL Server
Creates a SQL Server DataSource from a SQL server instance and binds it to a SectionReport object. The ComboBox present in this tab lets you populate the dropdown list with the existing SQL servers on the network.
Bind to OleDb
Creates an Oledb DataSource and binds it to a SectionReport object.
Bind to XML
Creates a XML DataSource from a file and binds it to a SectionReport object. The XML tab also features a Generate XML button that generates a DataSet and saves it as an XML data file. The generated file is then used as a data source for the report.
Project Details
MainForm
The MainForm uses the ActiveReports Viewer control in the bottom section of the form, and a panel docked to the top contains seven tabs, each with a different data binding technique.
Click to select a tab, and then double-click the button on the tab to jump to the button's Click event in the code.
Invoice Report
The Invoice report uses three GroupHeader sections, a Detail section and a GroupFooter section as well as a label in the PageFooter section to display data.
Note: Except for the Detail section, all sections come in header and footer pairs. Unused sections have their Height properties set to 0 and their Visible properties set to False. |
ghOrderHeader
This section also contains a Picture control, a number of Label controls, and two bound TextBox controls. The TextBoxes are bound using the DataField property in the Properties window, and the date is formatted using the OutputFormat property.
ghOrderID
This section contains a number of labels and bound text boxes, as well as two Line controls.
ghTableHeader
Detail
GFOrderID
This section contains several labels and several TextBoxes. Two of the TextBox controls use the following properties to summarize the detail data: SummaryFunc, SummaryGroup, and SummaryType. For more information, Create a Summary Report.
The Total TextBox does not use the DataField property or any of the summary properties, or even any code. To find the functionality of this TextBox, in design view, click the Script tab at the bottom of the report.
PageFooter