Application Design and Development For example, controls such as drop-down menus and list boxes can be associated with a DataSet object。 The DataSet object is similar to a JDBC ResultSet object, and is typically created by executing a query on the database。 The HTML menu contents are then generated from the DataSet object’s contents; for example, a query may retrieve the names of all departments in an organization into the DataSet, and the associated menu would contain these names。 Thus, menus that depend on database contents can be created in a convenient manner with very little programming。 Validator controls can be added to form input fields; these declaratively specify validity constraints such as value ranges, or whether the input is a required input for which a value must be provided by the user。 The server creates appropriate HTML code combined with JavaScript to perform the validation at the user’s browser。 Error messages to be displayed on invalid input can be associated with each validator control。 User actions can be specified to have an associated action at the server。 For example, a menu control can specify that selecting a value from a menu has an associated server-side action (JavaScript code is generated to detect the selection event and initiate the server-side action)。 Visual Basic/C# code that displays data pertaining to the selected value can be associated with the action at the server。 Thus, selecting a value from a menu can result in associated data on the page getting updated, without requiring the user to click on a submit button。 The DataGrid control provides a very convenient way of displaying query results。 A DataGrid is associated with a DataSet object, which is typically the result of a query。 The server generates HTML code that displays the query result as a table。 Column headings are generated automatically from query result metadata。 In addition, DataGrids provide several features, such as pagination, and allow the user to sort the result on chosen columns。 All the HTML code as well as server-side functionality to implement these features is generated automatically by the server。 The DataGrid even allows users to edit the data and submit changes back to the server。 The application developer can specify a function, to be executed when a row is edited, that can perform the update on the database。 Microsoft Visual Studio provides a graphical user interface for creating ASP pages using these features, further reducing the programming effort。 See the bibliographic notes for references to more information on ASP。NET。76930
Report generators are tools to generate human-readable summary reports from a database。 They integrate querying the database with the creation of formatted text and summary charts (such as bar or pie charts)。 For example, a report may show the total sales in each of the past 2 months for each sales region。 The application developer can specify report formats by using the formatting facilities of the report generator。 Variables can be used to store parameters such as the month and the year and to define fields in the report。 Tables, graphs, bar charts, or other graphics can be defined via queries on the database。 The query definitions can make use of the parameter values stored in the variables。 Once we have defined a report structure on a report-generator facility, we can store it and can execute it at any time to generate a report。 Report-generator systems provide a variety of facilities for structuring tabular output, such as defining table and column headers, displaying subtotals for each group in a table, automatically splitting long tables into multiple pages, and displaying subtotals at the end of each page。 Figure 9。12 is an example of a formatted report。 The data in the report are generated by aggregation on information about orders。 Report-generation tools are available from a variety of vendors, such as Crystal Reports and Microsoft (SQL Server Reporting Services)。 Several application suites, such as Microsoft Office, provide a way of embedding formatted query results from a database directly into a document。 Chart-generation facilities provided by Crystal Reports, or by spreadsheets such as Excel can be used to access data from databases, and generate tabular depictions of data or graphical depictions using charts or graphs。 Such charts can be embedded within text documents。