Getting a summary count in a view export?

前端 未结 2 1511
甜味超标
甜味超标 2021-01-17 01:26

I need to export a view to excel. I have already found some code somewhere and it is working great in xpages. Now the user wants to add a summary of totals. I will expla

2条回答
  •  野的像风
    2021-01-17 02:02

    You are on the right track in your last paragraph but you don't need to store the values in a session scope. A standard javascript object will do. Assuming you are generating your report by looping through the documents in the view, the quickest and easiest solution in my mind would be to count each equipment id as you loop through the documents and store the counts in an object:

    equipId[equipId1] equipId[equipId2] . . equipId[equipIdx]

    Then after you have looped through all your docs, loop through your equipment ID object values as you have in your sample report above.

    Looping through javascript objects: How do I loop through or enumerate a JavaScript object?

    Sorting a javascript object: Sorting JavaScript Object by property value

提交回复
热议问题