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 explain.
I have a document that contains a user name, project ID and Equipment ID. What I need to do is export all documents with a particular project ID, showing the user name and equpment id in the export but after the view is exported, show a summary total of the similar equipment IDs.
Something like this:
User Selected Equipment
Jonh Smith C1
Salley Johnson C2
Fred Days C1
Summary
C1 2
C2 1
What I thought of doing is using a categorized view first on project ID then on Equipment ID with a sum column, do a getAllDocumentsByKey from a NotesViewEntryCollection to get all of the documents for the selected project then leverage the category line to get my needed totals. But when I do only get one document for the getAllDocumentsByKey. If I remove the Equipment column and only categorize on Project ID then I get all expected documents.
Another thought I had was to have an object that I could store in a sessionscope varible and just sort on project id once againn using getalldocumentsbykey. The object would have an equipment ID variable and a total. As I work though the view, I would update the total for the current equipment id. Then at the end of the export of the view jut export this sessionscope table. But since I am new to javascript, I really don't know where to get started on this. Is this the right direction? If so could someone get me started?
Any other ideas?
P.S. The user would rather not have to use the Subtoal features of Excel.