Index: trunk/grails-app/controllers/TaskDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 253)
+++ trunk/grails-app/controllers/TaskDetailedController.groovy	(revision 260)
@@ -22,11 +22,28 @@
     }
 
+    def setTaskSearchParamsMax = {
+        if(params.newMax.isInteger())
+            def i = params.newMax.toInteger()
+            if(params.newMax.toInteger() > 0)
+        session.taskSearchParamsMax = params.newMax
+        params.max = params.newMax
+        forward(action: 'search', params: params)
+    }
+
     def search = {
-        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100 )
+
+        if(session.taskSearchParamsMax)
+            params.max = session.taskSearchParamsMax
+
+        // TaskSearchService protects itself but filterPane does not.
+        params.max = Math.min( params.max ? params.max.toInteger() : 10,  99999 )
+
+        def taskInstanceList = []
+        def taskInstanceTotal
+        def filterParams = [:]
+        def personInstance = personService.currentUser
 
         // Quick Search:
         if(!FilterUtils.isFilterApplied(params)) {
-            def taskInstanceList = []
-            def personInstance = personService.currentUser
 
             if(params.quickSearch == "searchMyTodays") {
@@ -52,12 +69,50 @@
                 params.quickSearch = "searchTodays"
             }
-            return[taskInstanceList: taskInstanceList, taskInstanceTotal: taskInstanceList.totalCount, filterParams: params]
-        }
-        // filterPane:
-        return[ taskInstanceList: filterService.filter( params, Task ),
-            taskInstanceTotal: filterService.count( params, Task ),
-            filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
-            params:params ]
-    }
+
+            taskInstanceTotal = taskInstanceList.totalCount
+            filterParams.quickSearch = params.quickSearch
+        }
+        else {
+            // filterPane:
+            taskInstanceList = filterService.filter( params, Task )
+            taskInstanceTotal = filterService.count( params, Task )
+            filterParams = com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params)
+        }
+
+        // export plugin:
+        if(params?.format && params.format != "html") {
+
+            def dateFmt = { date ->
+                formatDate(format: "EEE, dd-MMM-yyyy", date: date)
+            }
+
+            String title
+            if(params.quickSearch)
+                title = "${params.quickSearch} tasks."
+            else
+                title = "Filtered tasks."
+
+            response.contentType = ConfigurationHolder.config.grails.mime.types[params.format]
+            response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}")
+            List fields = ["id", "targetStartDate", "description", "leadPerson", "taskPriority", "taskStatus"]
+            Map labels = ["id": "ID", "targetStartDate": "Target Start Date", "description": "Description",
+                                    "leadPerson": "Lead Person", "taskPriority": "Task Priority", "taskStatus": "Task Status"]
+            Map formatters = [ targetStartDate: dateFmt]
+            Map parameters = [title: title, separator: ","]
+
+            exportService.export(params.format, response.outputStream, taskInstanceList, fields, labels, formatters, parameters)
+        }
+
+        // Add some basic params to filterParams.
+        filterParams.max = params.max
+        filterParams.offset = params.offset?.toInteger() ?: 0
+        filterParams.sort = params.sort ?: "id"
+        filterParams.order = params.order ?: "desc"
+
+        return[ taskInstanceList: taskInstanceList,
+                taskInstanceTotal: taskInstanceTotal,
+                filterParams: filterParams ]
+
+    } // end search()
 
     def searchCalendar = {
@@ -128,4 +183,8 @@
             // export plugin:
             if(params?.format && params.format != "html") {
+
+                def dateFmt = { date ->
+                    formatDate(format: "EEE, dd-MMM-yyyy", date: date)
+                }
                 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format]
                 response.setHeader("Content-disposition", "attachment; filename=tasks.${params.extension}")
@@ -133,7 +192,7 @@
                 Map labels = ["id": "ID", "targetStartDate": "Target Start Date", "description": "Description",
                                         "leadPerson": "Lead Person", "taskStatus": "Task Status", "taskType": "Task Type"]
-                Map formatters = [:]
+                Map formatters = [ targetStartDate: dateFmt]
                 String title = "${params.quickSearch} tasks in the last week."
-                Map parameters = [title: title]
+                Map parameters = [title: title, separator: ","]
 
                 exportService.export(params.format, response.outputStream, taskInstanceList, fields, labels, formatters, parameters) 
