Thursday, December 13, 2012

Order Form Sample–Part 29

Users can produce an order report by selecting an option from the Report menu on the action bar. The Print icon in the top left corner will activate the first option in the Report menu.

Using the 'PDF Document' action in the 'Report' menu of the action bar to create a report.

However, the default report only displays a top-down list of fields and values of the selected order. Order details are not present.

Default report displays a top-down list of fields and field values from the order record.

Let’s implement an action on the order form that will produce a report using a custom report template. This template will render the data in the same layout as the order form, and include all relevant order details.

Order report using a custom report template.

Such a report requires a denormalized data set joining rows from Orders, Order Details, Employees, and Shippers tables.

'Order Details', 'Orders', 'Customers', 'Employees', and 'Shippers' contain data needed for the report.

A denormalized data set can be created using one of the following methods:

  1. Using the Denormalization Field Map to extend the field set available in OrderDetails controller.
  2. Creating a data controller based on a database view that joins all required tables.

The data controller needs to be extended with a view that includes all data fields required for the report. A custom report template must be enabled for the view. The generated template can be customized directly in Visual Studio.

Finally, an action is needed to activate the report. Action parameters will map the current OrderID as a filter for the report data controller.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com