1427Chapter 57 .Application: (Web file server) Transforming XML Data Islands appendCell(newRow,
1427Chapter 57 .Application: Transforming XML Data Islands appendCell(newRow, Q2 , db[i].sales.Q2_2000.quotaPct + % ) appendCell(newRow, Q3 , db[i].sales.Q3_2000.forecast +
+ db[i].sales.Q3_2000.actual) appendCell(newRow, Q3 , db[i].sales.Q3_2000.quotaPct + % ) appendCell(newRow, Q4 , db[i].sales.Q4_2000.forecast +
+ db[i].sales.Q4_2000.actual) appendCell(newRow, Q4 , db[i].sales.Q4_2000.quotaPct + % ) accumQ1F += db[i].sales.Q1_2000.forecast accumQ1A += db[i].sales.Q1_2000.actual accumQ2F += db[i].sales.Q2_2000.forecast accumQ2A += db[i].sales.Q2_2000.actual accumQ3F += db[i].sales.Q3_2000.forecast accumQ3A += db[i].sales.Q3_2000.actual accumQ4F += db[i].sales.Q4_2000.forecast accumQ4A += db[i].sales.Q4_2000.actual appendCell(newRow, repTotal , db[i].totalForecast +
+ db[i].totalActual) appendCell(newRow, repTotal , db[i].totalQuotaPct + % ) } newRow = document.getElementById( mainTableBody ).insertRow(i) newRow.className = QTotal newRow.title = Totals appendCell(newRow, grandTotalLabel , Grand Total ) appendCell(newRow, Q1 , accumQ1F +
+ accumQ1A) appendCell(newRow, Q1 , getPercentage(accumQ1A, accumQ1F) + % ) appendCell(newRow, Q2 , accumQ2F +
+ accumQ2A) appendCell(newRow, Q2 , getPercentage(accumQ2A, accumQ2F) + % ) appendCell(newRow, Q3 , accumQ3F +
+ accumQ3A) appendCell(newRow, Q3 , getPercentage(accumQ3A, accumQ3F) + % ) appendCell(newRow, Q4 , accumQ4F +
+ accumQ4A) appendCell(newRow, Q4 , getPercentage(accumQ4A, accumQ4F) + % ) var grandTotalFcst = accumQ1F + accumQ2F + accumQ3F + accumQ4F var grandTotalActual = accumQ1A + accumQ2A + accumQ3A + accumQ4A appendCell(newRow, grandTotal , grandTotalFcst +
+ grandTotalActual) appendCell(newRow, grandTotal , getPercentage(grandTotalActual, grandTotalFcst) + % ) } // insert a cell and its content to a recently added row function appendCell(Trow, Cclass, txt) { var newCell = Trow.insertCell(Trow.cells.length) newCell.className = Cclass newCell.innerHTML = txt } // clear previous table content if there is any function deleteRows(tbl) { while (tbl.rows.length > 0) { tbl.deleteRow(0) } } Many standalone statements at the end of the drawTextTable()function are devoted exclusively to generating the Grand Total row, in which the accumulated column totals are entered. At the same time, the getPercentage() function,
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.