Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 10: Reporting > Overview of the Reporting Function

Overview of the Reporting Function

Now that you know what the desired result is, how do you get there? Start by adding some technical constraints to help frame the solution:

  • You want to be able to create multiple reports.
  • You want the report to be available in multiple formats, including PDF, HTML, TXT, RTF, XLS, CSV, and XML.
  • You believe in the DRY (principle and want to maintain a separation of concerns and encapsulation.
  • You want to leverage the Grails domain model and dynamic methods to retrieve the report data.

Taking these technical constraints into consideration, you can construct the solution illustrated in Figure 10-2.

image

Figure 10-2. Reporting facility overview

The first component in the top-left part of Figure 10-2 represents an HTML page. The HTML page needs to provide a way for users to indicate that they want to generate a report. You accomplish this by creating a report tag. You could just hard-code all the logic required to invoke the next step in the process, but knowing that you will have multiple reports, that would be a lot of copying, pasting, and tweaking. It wouldn't be very user friendly to the HTML developer either. By creating a tag, you're able to encapsulate all of the invocation knowledge.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint