Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | Tags | Help
How to show View Category totals in a Repeat control? 
What is the best way to show View Category Totals in a repeat control?  I have a view that is categorised my a person's name and then there's another category by Date.  I'm not interested in the detail rows a this time.
 
The view look list this...
 
Name                Name Total
    Date            Daily Total
        Shipper        Cost
        Shipper        Cost
    Date            Daily Total
        Shipper        Cost
        ....

I'm only interested in showing the Daily totals for a given name.
 
 
I've bound the categorized view to the custom control. I have a combo box on the control to select a name. And I'm using the views "categoryFilter" to only show the records for a particular user.

The repeat control is bound to the view.

I tried using computed fields to check if the "rowData" was "isCategory()".  If it was true I returned the value, if it was not I did not return the value.  This "LOOKED" promising until I turned borders on and say that the rows I tried to skip were still being sent to the browser.
 
I then tried applying that logic to the tablerow itself using the rendered property.  I had a little more sucess there as the detail words aren't rendering BUT the linked Pager controls think the deal records are there.  doh!

There's got to be a better way to just grab and display totals.
 
Thanks!!
 
 
Domino Development / XPages
David Leedy - about 1 year ago |  |  | Viewed 402 times

There are 3 answers

0votes
Not sure about an exact answer without some work, but you may want to check Steve Castledine's article about hide detail rows in a view:
 
http://www.stevecastledine.com/sc.nsf/dx/xpages-hide-detail-rows 
 
Also have a look at data tables rather than a repeat control, maybe they can help? 


Matt White - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


1votes
Matt,
 
Thanks for the link.  I remember that article now, but didn't look at it today. I'm actually using this technique BUT it's not what I'm looking for.  His posting is a method of hiding the Value of the number in the detail records.  But he's still displaying the detail records themselves.
I only want to return the category totals to the browser - I don't want any detail records at all.   Say I have 30 days worth of shipments.  Hundreds of shipments on each day.  I'm looking to only show daily totals.  Maybe a repeat control isn't the way to go.  In Lotusscript I could get this with a viewnavigator I guess and then write it out to the browser in a manually built table...  Not sure how that might work in xpages...  I guess maybe I could do that in SSJS as the value of a computed field that's set to display html.... does that make sense?
 
I've not looked at data tables.  Not sure what they're for but I'll check it out.

Thanks!


David Leedy - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes
David,
 
I have the following repeat control formula working against a categorized view so that it only returns the category values and the total I want.
 
The view is categorized view by year/month with totals for the month. 
 
 The formula is
 
var colIndVal = viewEntries.getNavigatorPosition();

if(@Length(colIndVal)==1){
var colVal = viewEntries.getColumnValue("$9");
return colVal + "<br />";
} else if(@Length(colIndVal)==3) {
var colVal = viewEntries.getColumnValue("CatMonth");
var colVal2 = viewEntries.getColumnValue("Total");
return colVal + "-" +colVal2 + "<br />";
} else {

}
 
 
And the output is: 
 2009
February-192.78947368421052
March-139.53846153846155
April-124.18518518518519
May-117.55172413793103
June-111.38095238095238
July-113.05
August-119.71428571428571
September-107.46153846153847
October-115.15789473684211
2010
January-114.25
February-113.53333333333333
 
So based upon the level of category it will return the result from the view for each category but return no values for the detail rows.  The formula would have to be adjusted for how many category columns you had (in this example I have two) 
 
I haven't tried it yet but I believe I can stick this inside my dynamic table solution to produce a table so that the values are separated into columns for display purposes.
 
I will try that next but I think this should work for you. 
 
I will work on the table solution and let you know. 
 
 


Paul Calhoun - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community