Greetings all,
I have a component using Wonder's ExcelGenerator framework, which is based on another component which is also using batching display groups. I have a button which is supposed to generate an excel document version of the displayGroup. I also am adding a row at the bottom of the excel page which is supposed to give me a grand total of all the objects in the displayGroup, for that column. This all works, assuming the user did not set any queryMatch dictionary values on the preceding search page.
My action to do this returns the following excelPage:
WOComponent excelPage = pageWithName(MyExcelComponent.class.getName());
excelPage.takeValueForKey(displayGroup().filteredObjects(), "arrayOfObjects");
excelPage.takeValueForKey(minRefreshDate(), "minRefreshDate"); excelPage.takeValueForKey(displayGroup().allObjects().valueForKeyPath("@sum.myFieldValue"), "myFieldValueGrandTotal"); ...
Unfortunately, where the user did a search using values from the queryMatch dictionary, the @sum seems to give the total of all objects in the displayGroup and not just the ones that match the queryMatch. Apparently filteredObjects() is overridden to use allObjects() where the displayGroup is batching. Obviously, I don't need to batch the excel page, so I thought about setting the displayGroup isBatching = false; but there seems to be no such method. So I thought I'd post this as a question for the list.
So in short (?) we have a search page, which qualifies the displayGroup based on some information the user has no control over (e.g. does this user have access to this data), and also has user entry fields which are used via queryMatch to further qualify the displayGroup. The results in the web page are properly totaled pages, which the proper number of batches. The excel page version is not supposed to batch (obviously), but rather display all the data in all batches in one excel file, with a total of all (subject to all the qualifiers and queryMatch values). The total seems to be the totals all in the displayGroup, without considering the queryMatch values. However, in the debugger, the displayGroup has the queryMatch values, and the qualifier has that as a limitation, yet does still return totals for all objects including those which do not match the query match.
Any ideas? What am I missing/doing wrong?
Andrew |