The CategorySelection sample demonstrates passing a SQL string into a report at run time. It consists of a CategorySelectForm and CategoryProducts report.
Sample Location
Visual Basic.NET
<User Folder>\Documents\GrapeCity Samples\ActiveReports 12\Section Reports\Layout\CategorySelection\VB.NET
C#
<User Folder>\Documents\GrapeCity Samples\ActiveReports 12\Section Reports\Layout\CategorySelection\C#
Run-Time Features
When you run this sample, a form containing a Viewer control and a ComboBox control within a panel is displayed. The Select a Product Category ComboBox at the top of the form allows the users to select the type of data they want to display in the Viewer control.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents folder]\GrapeCity Samples\ActiveReports 12\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.
Project Details
CategorySelectForm
The Viewer control fills most of the form, and a ComboBox at the top allows the user to select which data to send to the Viewer control.
To see how all of this works, right-click the form and select View Code.
CategoryProducts
This report lists the products in the selected category, and summarizes the number of products.
ReportHeader section
PageHeader section
This section uses Label controls, Line controls and a TextBox. DataField property of txtCategory TextBox is set to CategoryName. Two Line controls and three Label controls create the report title and the column headers for this report.
Detail section
PageFooter section
ReportFooter section