3 Replies Latest reply: Dec 28, 2012 8:44 AM by fac586 RSS

    How to dispaly Total or sum at the buttom of IR report

    Saroj Nayak
      Hi,

      How to dispaly Total or sum text at the buttom of Interactive Report in apex 4.0,also is there any way for simplest method.
        • 1. Re: How to dispaly Total or sum at the buttom of IR report
          fac586
          Aggregating a column is a basic built-in feature of interactive reports, using Action > Format > Aggregate.
          • 2. Re:How to dispaly Total or sum text at the left side buttom of theIR report
            Saroj Nayak
            Hi,

            My question is how to display the text TOTAL on the left side of the IR report as we can able to dispaly the total in sql standard report,By default none text displaying left side buttom of the IR report.
            • 3. Re:How to dispaly Total or sum text at the left side buttom of theIR report
              fac586
              Saroj Nayak wrote:

              My question is how to display the text TOTAL on the left side of the IR report as we can able to dispaly the total in sql standard report,By default none text displaying left side buttom of the IR report.
              There's a problem with the standard report feature: +{thread:id=2354304}+

              This is potentially even more problematic in an IR as the user can choose which columns to display, the order they're displayed, and which columns are aggregated, so one of the totals may be "clobbered" by indiscriminately displaying the "text *TOTAL* on the left side of the IR report".

              However, if the IR has a link column that will always be visible then the total header can be injected into the last row of that column using a Dynamic Action.

              Add a Dynamic Action to the page:
              h4. When

              Event: After Refresh
              Selection Type: Region
              Region: <Your IR Region>

              h4. True Action

              Action: Execute JavaScript Code
              Fire On Page Load: Yes
              Code:
              $('tr td.apexir_AGGREGATE_VALUE[headers*="LINK"]')
                .each(function () {
                  var td = $(this),
                      th = $('<th><div>Total</div></th>');
                  td.replaceWith(th);
                  th.addClass(td.attr('class')).attr('headers', td.attr('headers'));
                });
              Ensure that the IR region template setting is not No Template or the DA won't work.

              Edited by: fac586 on 28-Dec-2012 14:43

              Improved JS code to retain class and header attributes from replaced cell.