10.3. Solution

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:

MenuItemNameUrlParentENT MenuItemIdDisplay SequenceIsAlways Enabled
Report ListingReports/ReportList.aspxReports (ID)1False

Now add the following capabilities to the ENTCapability table:

CapabilityNameENTMenuItemIdAccessType
PTO Requests ReportReport Listing ID1
Role Report ...

Get ASP.NET 3.5 Enterprise Application Development with Visual Studio® 2008: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.