peterhanse Posted November 24, 2015 Report Share Posted November 24, 2015 i want use a aggregated total in the footer . is that posible for example: <script> var paard = "voeg uw paard toe!"; var voegtoe = "upgrade uw acount!"; if("cbResultSetTotalsData cbResultSetTotalsDataCellNumberDate" >0) { document.write("<p>Link: " + paard.link("http://google.nl") + "</p>") } else { document.write("<p>Link: " + voegtoe.link("http://caspio") + "</p>") } </script> Quote Link to comment Share on other sites More sharing options...
0 Xiang Posted November 25, 2015 Report Share Posted November 25, 2015 Hi peterhanse, Welcome to the Forum! How are you? I think, you can use the following code: <script> var column_number = 1; var myTable = document.getElementsByName("cbTable")[0]; var myRows = myTable.getElementsByTagName("tr"); var lastRow = myRows.length - 1; var myCells = myRows[lastRow].getElementsByTagName("td"); var myTotal = parseFloat(myCells[column_number].innerHTML); var paard = "voeg uw paard toe!"; var voegtoe = "upgrade uw acount!"; if(myTotal>0) { document.write("<p>Link: " + paard.link("http://google.nl") + "</p>") } else { document.write("<p>Link: " + voegtoe.link("http://caspio") + "</p>") } </script> Where column_number is the number of the Aggregation. If you use only one Aggregation, it'll be "1". I'll be grateful, if you tell me if the code works.Have a nice day! MayMusic 1 Quote Link to comment Share on other sites More sharing options...
0 peterhanse Posted November 26, 2015 Author Report Share Posted November 26, 2015 xiang ,tanks works perect Quote Link to comment Share on other sites More sharing options...
0 peterhanse Posted January 31, 2016 Author Report Share Posted January 31, 2016 Hi xiang, your solution below works well if there is a record in the table or view . if it is empty , he gets stuck on "no records found" . what can we do about it . <script> var column_number = 1; var myTable = document.getElementsByName("cbTable")[0]; var myRows = myTable.getElementsByTagName("tr"); var lastRow = myRows.length - 1; var myCells = myRows[lastRow].getElementsByTagName("td"); var myTotal = parseFloat(myCells[column_number].innerHTML); var paard = "voeg uw paard toe!"; var voegtoe = "upgrade uw acount!"; if(myTotal>0) { document.write("<p>Link: " + paard.link("http://google.nl") + "</p>") } else { document.write("<p>Link: " + voegtoe.link("http://caspio") + "</p>") } </script> Quote Link to comment Share on other sites More sharing options...
0 Farnsbarnes Posted February 19, 2020 Report Share Posted February 19, 2020 I think the above code might be able to help me. In my report I have fields for 'year', 'region', 'country', 'product' and 'tonnage'. The 'region' field is a calculated field. I wish to show aggregates of my data by region, but also for each year. Caspio prevents me grouping data by 'region' because 'region' is a calculated field. And I can't use 'Totals & Aggregation' either because Caspio only allows me to use 5 of those. My mix of 'region' and 'year' could end up being many aggregate totals. I could be wrong but I think the 5 year-old code from Xiang (above) allows me to add aggregate rows at the bottom of the table... or am I being too optimistic?! Anyhow, I tried to get his code to work but I think it uses old Caspio commands and all I get is error "Cannot read property 'getElementsByTagName' of undefined". Is anyone able to make adjustments to this code to make it more generic? Alternatively does anyone have any other suggestions on what I can do? Many thanks Quote Link to comment Share on other sites More sharing options...
Question
peterhanse
i want use a aggregated total in the footer . is that posible
for example:
<script>
var paard = "voeg uw paard toe!";
var voegtoe = "upgrade uw acount!";
if("cbResultSetTotalsData cbResultSetTotalsDataCellNumberDate" >0)
{
document.write("<p>Link: " + paard.link("http://google.nl") + "</p>")
}
else
{
document.write("<p>Link: " + voegtoe.link("http://caspio") + "</p>")
}
</script>
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.