Index: trunk/grails-app/controllers/InventoryItemDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/InventoryItemDetailedController.groovy	(revision 390)
+++ trunk/grails-app/controllers/InventoryItemDetailedController.groovy	(revision 392)
@@ -1,3 +1,4 @@
 import org.codehaus.groovy.grails.plugins.springsecurity.Secured
+import org.codehaus.groovy.grails.commons.ConfigurationHolder
 
 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager'])
@@ -5,4 +6,5 @@
 
     def filterService
+    def exportService
     def inventoryItemService
     def inventoryMovementService
@@ -14,18 +16,90 @@
     def index = { redirect(action:search, params:params) }
 
+    /**
+    * Set session.inventoryItemSearchParamsMax
+    */
+    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
+    def setSearchParamsMax = {
+        def max = 1000
+        if(params.newMax.isInteger()) {
+            def i = params.newMax.toInteger()
+            if(i > 0 && i <= max)
+                session.inventoryItemSearchParamsMax = params.newMax
+            if(i > max)
+                session.inventoryItemSearchParamsMax = max
+        }
+        forward(action: 'search', params: params)
+    }
+
     @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
     def search = {
+
+        if(session.inventoryItemSearchParamsMax)
+            params.max = session.inventoryItemSearchParamsMax
+
         params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
+
+        def inventoryItemInstanceList = []
+        def inventoryItemInstanceTotal
+        def filterParams = [:]
 
         // Quick Search:
         if(!params.filter) {
-            return[ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count(), filterParams: params ]
-        }
+            inventoryItemInstanceList = InventoryItem.list( params )
+            inventoryItemInstanceTotal = InventoryItem.count()
+            filterParams = params
+        }
+        else {
         // filterPane:
-        return[ inventoryItemInstanceList: filterService.filter( params, InventoryItem ),
-                inventoryItemInstanceTotal: filterService.count( params, InventoryItem ),
-                filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
-                params:params ]
-    }
+            inventoryItemInstanceList = filterService.filter( params, InventoryItem )
+            inventoryItemInstanceTotal = filterService.count( params, InventoryItem )
+            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 = "Inventory List."
+
+            response.contentType = ConfigurationHolder.config.grails.mime.types[params.format]
+            response.setHeader("Content-disposition", "attachment; filename=Inventory.${params.extension}")
+            List fields = ["name",
+                                "description",
+                                "unitsInStock",
+                                "unitOfMeasure",
+                                "inventoryLocation",
+                                "inventoryLocation.inventoryStore"]
+            Map labels = ["name": "Name",
+                                "description": "Description",
+                                "unitsInStock":"In Stock",
+                                "unitOfMeasure": "UOM",
+                                "inventoryLocation": "Location",
+                                "inventoryLocation.inventoryStore": "Store"]
+
+            Map formatters = [:]
+            Map parameters = [title: title, separator: ","]
+
+            exportService.export(params.format,
+                                                response.outputStream,
+                                                inventoryItemInstanceList.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) },
+                                                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[ inventoryItemInstanceList: inventoryItemInstanceList,
+                inventoryItemInstanceTotal: inventoryItemInstanceTotal,
+                filterParams: filterParams ]
+    } // end search()
 
     /**
Index: trunk/grails-app/views/inventoryItemDetailed/create.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/create.gsp	(revision 390)
+++ trunk/grails-app/views/inventoryItemDetailed/create.gsp	(revision 392)
@@ -51,5 +51,6 @@
                                     <g:select optionKey="id"
                                                         from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
-                                                        name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}" >
+                                                        name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}"
+                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}">
                                     </g:select>
 
Index: trunk/grails-app/views/inventoryItemDetailed/edit.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 390)
+++ trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 392)
@@ -83,5 +83,6 @@
                                                         from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
                                                         name="inventoryLocation.id"
-                                                        value="${inventoryItemInstance?.inventoryLocation?.id}" >
+                                                        value="${inventoryItemInstance?.inventoryLocation?.id}"
+                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}">
                                     </g:select>
                                 </td>
Index: trunk/grails-app/views/inventoryItemDetailed/search.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 390)
+++ trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 392)
@@ -9,4 +9,5 @@
         <g:render template="/shared/pictureHead" />
         <filterpane:includes />
+        <export:resource />
     </head>
     <body>
@@ -26,9 +27,53 @@
 
             <div class="paginateButtons">
+                Results: ${inventoryItemInstanceList.size()} / ${inventoryItemInstanceTotal}
                 <span class="searchButtons">
                     <filterpane:filterButton text="Search" appliedText="Change Search" />
                 </span>
-                Results:${inventoryItemInstanceTotal}
             </div>
+
+            <jsUtil:toggleControl toggleId="options"
+                                                    imageId="optionsImg"
+                                                    closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}"
+                                                    openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}"
+                                                    text="${g.message(code: 'default.options.text')}"
+                                                    />
+
+            <div id="options" style="display:none;">
+                <g:form method="post" >
+                    <g:hiddenField name="params" value="${filterParams}" />
+                    <div class="dialog">
+                        <table>
+                            <tbody>
+
+                                <tr class="prop">
+                                    <td valign="top" class="name">
+                                        <label for="max">Results per page:</label>
+                                    </td>
+                                    <td valign="top" class="value">
+                                        <input type="text" maxlength="4" id="description" name="newMax" value="${params.max}"/>
+
+                                        <span class="buttons">
+                                            <g:actionSubmit action="setSearchParamsMax" class="go" value="Update" />
+                                        </span>
+                                    </td>
+                                </tr>
+
+                            </tbody>
+                        </table>
+                    </div>
+                </g:form>
+                <export:formats  params="${filterParams}" formats="['csv', 'excel', 'pdf', 'rtf']"/>
+            </div>
+
+            <br />
+
+            <g:if test="${inventoryItemInstanceList.size() > 10}">
+                <g:if test="${inventoryItemInstanceTotal > inventoryItemInstanceList.size()}">
+                    <div class="paginateButtons">
+                        <g:paginate total="${inventoryItemInstanceTotal}" params="${filterParams}" />
+                    </div>
+                </g:if>
+            </g:if>
 
             <div class="list">
Index: trunk/grails-app/views/inventoryItemDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/show.gsp	(revision 390)
+++ trunk/grails-app/views/inventoryItemDetailed/show.gsp	(revision 392)
@@ -133,4 +133,5 @@
                                                 ${inventoryItemInstance.inventoryLocation?.encodeAsHTML()}
                                             </g:link>
+                                                in ${inventoryItemInstance.inventoryLocation?.inventoryStore.encodeAsHTML()}
                                         </td>
                                     </tr>
