April 9th, 2010, 10:53 AM
Creating reports withing the MVC
I have created a web application using the model view controller design pattern.
In my model I have a variety of classes that represent different elements in the application e.g. client, project, record etc.
Each of these classes has its own data mapper with functions like save and fetch all.
I need to now create a variety of reports that can be exported as CSVs, PDFs etc.
I am not sure of the best way to do this. The reports arent related to a set object e.g. show all projects with certain record types for a certain client.
Can anyone explain to me the best way of implementing these reports.
At the moment I am considering having a class called reports with a function for each report that gets the data from the database, I would then get the data and pass it to the view for exportation.
I am really not sure and would be very greatful if someone can explain to me the best way of completing this task.
Many thanks in advance