Remember Mary? She asked for three reports that would enable her to view the list of outstanding requests, the list by current owner, and the list of approved requests. These are all the same report but with different filters. The solution section will show you how to incorporate the query builder control in the PaidTimeOffSolution and create the pattern for generic reporting. Two new pages will be added to the application: one that displays the list of reports and a second that enables users to apply a filter to a report and preview it in PDF. The first screen looks like Figure 10-3.
Figure 10.3. Figure 10-3
This is very similar to the grid pages developed in the previous chapters. It uses the custom GridView control and when the user clicks the Run button, it displays the second page (refer to Figure 10-1).
To build this functionality you first need to create the menu item for the Report Listing link and the capabilities associated with the report. The capabilities will be at the report level so that users can control access for each report.
Add the following record to the ENTMenuItem table:
|MenuItemName||Url||ParentENT MenuItemId||Display Sequence||IsAlways Enabled|
|Report Listing||Reports/ReportList.aspx||Reports (ID)||1||False|
Now add the following capabilities to the ENTCapability table:
|PTO Requests Report||Report Listing ID||1|
|Role Report ...|