Precondition
I have nine (9) columns that I want to sum in a list control. The control has two (2) nested groups based on the fields: Category and Subcategory. Yes, there are more elegant data structures but this is what I have. The nine columns are returned via a MySQL view, which itself is a compound view composed of sub views. All the columns I want to sum are numeric.
Success
When I edit the Client-side Grouping dialog and enter the Header > HTML expression by configuring three (3) summary values, I have success!
'<B>'+
'<div>'+group+'</div>'+
'<div>'+Number(this.groupSummary(data,'Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'<div>'+Number(this.groupSummary(data,'Budget_Modifications:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'<div>'+Number(this.groupSummary(data,'Amended_Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'</B>'
Failure
However, when I try to add a fourth (4th) column from ANY one of the nine (9) columns that I need to summarize, Alpha returns the following error. "Unexpected data type '\' - 'LongText' in rpresult_to_conditionalresult" Use any of the four or more summaries from below, and I get the same error.
My suspicion is the length of the Javascript I am passing into the handler is too long. See "The summaries I can choose from" below for the full string, sans the HTML div & span tags to make the values align to the columns. Each line is represents a summary column.
Next Steps?
I followed the suggestion from the Group Header Expression dialog: "For the ultimate in flexibility, you can define your own Javascipt function to compute the header HTML. Your function will take two parameters, group and data. For example you might define this expression for the header HTML: myFunction(group, data)"
I added the function and can return the group to the header easily, but the data parameter is apparently a object of Objects. At least that is what it appears to be when I perform a .toString() function on the data parameter in JavaScript functions and return it to the header.
Specific Need for Help
Any suggestions on how I can summarize all nine (9) of my columns, or work with the data parameter? Or how can I deal with the collection of objects?
N.B. AlphaSoftware: A video or a dialog sure would help.
The summaries I can choose from -- but I need them all...
Number(this.groupSummary(data,'Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Budget_Modifications:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Amended_Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Totals_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Committed_Costs_to_Date:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Remaining_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Anticipated_Costs_and_Pending_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Uncommitted_Costs:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Budget_Remaining:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')
ListHeaderIssue.PNG
Works up to three.
ListHeaderWorksUpTo3.PNG
I have nine (9) columns that I want to sum in a list control. The control has two (2) nested groups based on the fields: Category and Subcategory. Yes, there are more elegant data structures but this is what I have. The nine columns are returned via a MySQL view, which itself is a compound view composed of sub views. All the columns I want to sum are numeric.
Success
When I edit the Client-side Grouping dialog and enter the Header > HTML expression by configuring three (3) summary values, I have success!
'<B>'+
'<div>'+group+'</div>'+
'<div>'+Number(this.groupSummary(data,'Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'<div>'+Number(this.groupSummary(data,'Budget_Modifications:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'<div>'+Number(this.groupSummary(data,'Amended_Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+'</div>'+
'</B>'
Failure
However, when I try to add a fourth (4th) column from ANY one of the nine (9) columns that I need to summarize, Alpha returns the following error. "Unexpected data type '\' - 'LongText' in rpresult_to_conditionalresult" Use any of the four or more summaries from below, and I get the same error.
My suspicion is the length of the Javascript I am passing into the handler is too long. See "The summaries I can choose from" below for the full string, sans the HTML div & span tags to make the values align to the columns. Each line is represents a summary column.
Next Steps?
I followed the suggestion from the Group Header Expression dialog: "For the ultimate in flexibility, you can define your own Javascipt function to compute the header HTML. Your function will take two parameters, group and data. For example you might define this expression for the header HTML: myFunction(group, data)"
I added the function and can return the group to the header easily, but the data parameter is apparently a object of Objects. At least that is what it appears to be when I perform a .toString() function on the data parameter in JavaScript functions and return it to the header.
Specific Need for Help
Any suggestions on how I can summarize all nine (9) of my columns, or work with the data parameter? Or how can I deal with the collection of objects?
N.B. AlphaSoftware: A video or a dialog sure would help.
The summaries I can choose from -- but I need them all...
Number(this.groupSummary(data,'Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Budget_Modifications:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Amended_Budget:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Totals_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Committed_Costs_to_Date:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Remaining_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Anticipated_Costs_and_Pending_Commitments:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Uncommitted_Costs:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')+ '~'+
Number(this.groupSummary(data,'Budget_Remaining:N','sum')).toFormat('$#,##0.00;$ (#,##0.00);------')
ListHeaderIssue.PNG
Works up to three.
ListHeaderWorksUpTo3.PNG
Comment