Create an OleDbDataAdapter. Use the DataAdapter Configuration Wizard to configure the adapter. This builds a database connection for the adapter and defines the SQL query used to select data.
Select the adapter. Below the Properties window, click the "Generate DataSet" link.
Select the Project menu's Add New Item command and add a Crystal Report to the project.
In the Standard Report Expert's "Available data sources" list, select:
Project Data
ADO.NET DataSets
howto_net_data_report_iif.StudentsDataSet
Students
Then click the Insert Table button to select it. Click Next.
Add all of the selected fields to the display list.
Click the Formula button. Enter Warning as the formula's name. In the Formula Editor, enter:
Formula = IIF({Students.Score} < 75, "!", "")
Put a CrystalReportViewer control on the form.
When you run the program, if a database login dialog appears, cancel it.
|