Report totals with a twist

Good Morning,
I have a report, that I want to display the totals in the footer of the report. The main query is below. The report breaks on the the first column. This a classic report, using APEX 3.2.1. The report works correctly, but now I want to be able to display a summary section of Funding Types and the total per that funding type. I have used the sum function on the Funding cost column, but it gives me a subtotal on the break and grand total at the end.
Main Query.
select      V.DFCY_SEQNO||' - '||V.DFCY_NAME as Deficiency,
      V.DFCY_SMY_NARR,
      V.DFCY_STATUS,
      C.DFCY_CATG,
         NULL AS FUND_TYPE,
         NULL AS RQRMT_TYPE,
         NULL AS FUNDG_FY,
         NULL AS FUNDG_COST
from     V_DFCY_BASE V, DFCY_CATG_LU C
where   V.DFCY_CATG_C = C.DFCY_CATG_C
and     V.DFCY_CATG_C = 1
and     V.DFCY_STATUS not like ('closed%')
---FUNDING
UNION
select      V.DFCY_SEQNO||' - '||V.DFCY_NAME as Deficiency,
      NULL,
      NULL,
      NULL,
         FT.FUNDG_TYPE,
         FR.FUNDG_RQRMT_TYPE,
         F.FUNDG_FY,
         F.FUNDG_COST
from     V_DFCY_BASE V,
         DFCY_CATG_FUNDG F,
         FUNDG_TYPE_LU FT,
         FUNDG_RQRMT_TYPE_LU FR
where  V.DFCY_SEQNO = F.DFCY_SEQNO
and   FT.FUNDG_TYPE_C = F.FUNDG_TYPE_C
and   FR.FUNDG_RQRMT_TYPE_C = F.FUNDG_RQRMT_TYPE_C
and   V.DFCY_CATG_C = 1
and   V.DFCY_STATUS not like ('closed%')
ORDER BY DEFICIENCYSummary query I want display in the region footer. I thought I could place this in the region footer of the report, but right now it displays the code.
  Select FT.FUNDG_TYPE, sum(nvl(FUNDG_COST,0))         
  FROM     V_DFCY_BASE V,
         DFCY_CATG_FUNDG F,
         FUNDG_TYPE_LU FT
  WHERE  V.DFCY_SEQNO = F.DFCY_SEQNO
   and   FT.FUNDG_TYPE_C = F.FUNDG_TYPE_C
   and   V.DFCY_CATG_C = 1
   and   V.DFCY_STATUS not like ('closed%')
  GROUP BY FT.FUNDG_TYPE
  ORDER BY FT.FUNDG_TYPEAny help is appreciated.
Thanks,
Mary
Edited by: MaryM on Aug 30, 2010 2:47 PM

Bob: You need a spot of Ajax for this, take 2 pills and call me in the morning. :-)
I modified my example page to do this http://htmldb.oracle.com/pls/otn/f?p=24317:38
Basically, add a text field, like you already did. But the trick is that changes to this field need to be saved using Ajax (because the page is not being submitted during pagination so the normal session state saving mechanism doesn't kick in).
Change the Region Footer code to the following
<script>
function save_timeout()
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=do_nothing',0);
get.add('P38_TIMEOUT',$x('P38_TIMEOUT').value);
get.get();
get = null;
function NextSlide()
  var s=document.getElementsByName('X01')[0];
  var l_this=s.selectedIndex,l_total=s.options.length;
  var l_next=((l_this+1)==l_total)?0:l_this+1;
  s.selectedIndex=l_next;
  // save the user-specified timeout
  save_timeout();
  s.onchange();
var g_timeout=$x('P38_TIMEOUT').value;
setTimeout("NextSlide()",g_timeout?g_timeout*1000:1000*10);
</script>where do_nothing; is a Application Process that does nothing (PL/SQL block with NULL;)
Hope this helps.

Similar Messages

  • Report totals with dimension hierarchy column on pivot table incorrect

    Hi,
    I have a pivot table based report that has one dimension column, a dimension hierarchy column and various measures.
    The row totals do not match, detail to total, and I have tried both complex server based aggregate and report based aggregation, but neither are giving me the correct answer.
    I have also tried adding the column that is the same as the top level as the hierarchy, but hidden, but this does not help.
    I have also tried adding the lowest level of detail column, but hidden, but this does not give me the solution I need as all of the figures then appear at detail not aggregated level.
    Any ideas please?
    thanks,
    Robert.

    Can you validate the query hitting to the database and compare the results?
    Mark if helps.
    Thanks,

  • If I check the sum box on a report item, the words "report total:" appear..

    I would like it to read: Report Total With capital letters.
    Any up would be appreciated.

    Hello,
    Take a look at the "Display this text when printing report sums" setting in the Report Attributes.
    John.
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • MATRIX WITH GROUP     (REPORT TOTAL PROBLEM)

    DEAR FRIENDS,
    I HAVE A PROBLEM IN GROUP ABOVE MATRIX IN THE REPORT TOTAL.
    THE SCENARIO IS THIS...
    VEHICLE : CAR
    ----------------------- WEEK1 WEEK2 WEEK3 TOTAL
    ESTEEM 10 30 40 80
    ZEN 30 40 10 80
    DELUX 40 30 10 80
    SUB TOTAL 80 100 60 240
    VEHICLE : VAN
    ----------------------- WEEK1 WEEK2 WEEK3 TOTAL
    OMNI 10 30 40 80
    OMNIDX 30 40 10 80
    OMNILX 40 30 10 80
    SUB TOTAL 80 100 60 240
    GRAND TOTAL 160 200 120 480.
    IN THIS VEHICLE IS THE GROUP AND WEEK1,WEEK2... IS MATRIX COLUMNS AND ZEN,ESTEEM IS MATRIX ROWS.
    I AM UNABLE TO INCORPORATE THE GRAND TOTAL IN THIS TYPE OF REPORT. I AM USING 10G VERSION 9.0.4.
    PLEAE TELL ME HOW TO DO THAT.
    THANKS
    VENKY.

    If you got your subtotals to work than getting your grand total shouldn't be difficult at all. Your grand total column summaries should be one grouping above where your subtotal column summaries reside. I am guessing this will put them at the report level. Meaning they will not be in a group, just free floating in your data model. Good luck.

  • How to show the break totals and NOT the report totals in an SQL report

    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?
    PaulP

    PaulP wrote:
    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?Instead of using the APEX break feature, try doing all of this in the query using <tt>GROUPING SETS</tt> or <tt>ROLLUP</tt> to get the break rows, and <tt>GROUPING_ID</tt> in the <tt>HAVING</tt> clause to suppress the unwanted rows.
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?Don't really understand what's meant here?

  • Matrix report not printing report totals

    I've created a 'Matrix with Group' report using the wizard that works great. It prints the sub-totals for each product at the end of each group, but won't print a grand total for each product at the end of the report - just displays a grand total for all products. I've tried many ways to try to add a report total for each product but get the annoying below frequency/bad product order errors. I'm using builder 9.0.4.0.33

    I've created a 'Matrix with Group' report using the wizard that works great. It prints the sub-totals for each product at the end of each group, but won't print a grand total for each product at the end of the report - just displays a grand total for all products. I've tried many ways to try to add a report total for each product but get the annoying below frequency/bad product order errors. I'm using builder 9.0.4.0.33

  • Does Classic report provide facility to make report total to be hyperlink

    Hi ,
    Does Classic report in apex provide provision to make the report-total row editable(hyperlinked) ? if so how to implement that.
    Acq     WIP     Closed
    Abc     1     3
    Def     2     5
    report total :     3     8
    Also is it possible to provide more than 2 downloadable options for classic report :
    For eg: now i have provided options to export a report to csv and excel format, along with these two can i provide pdf option!!!!
    Thanks in advance

    You didn't mention what version of Apex you are using. If you are on 4.0, this can be done easily using dynamic actions.
    Here is an example http://apex.oracle.com/pls/apex/f?p=24317:92
    One DA that looks like this http://screencast.com/t/djyAG6F4WFM
    The first TRUE action (fire on page load) changes the cursor style to indicate that the row is clickable http://screencast.com/t/Z3YIXo6c
    The second one actually does the redirect http://screencast.com/t/jHMtyDwK8lM in the example it just shows an alert message but you can modify it to pass in whatever parameters you need and construct the location.href to redirect to.

  • Report Total lable when "repeat heading on break"

    Hi,
    I have a report where I'm breaking on the first column, and returning the totals.
    When I have "Default Break Formatting", since I am returning totals based on the first column, it says report total under the first column.
    However, If I have "Repeat heading on break", the first column won't show as one of the columns in the report, but it will show above the box. Because that first column is not gone, I realized that the lable "report total" is gone too, since there is no space to put it. It is still returning the totals correctly, but there is no lable that says "total" or anything like that.
    I wouldn't mind having that label on the second column, or someplace else. Can I do this?
    Thanks!

    Lila,
    If you want to take advantage of the features that HTML DB reports offer, such as column heading sorting, then writing your own PL/SQL region would not be an option. I was only confirming your observation that repeating headings only works for the first break column and suggesting an alternative approach. So you'll have to decide which is more important in your case, getting the formatting you're looking for or using those advanced reports features.
    As for the previous posting regarding new and older versions of HTML DB, HTML DB 1.5 was our first production release, shipped with the Oracle 10G database, and this version as well as HTML DB 1.5.1 offers the same kind of report heading sorting and the same type of column breaks.
    Regards,
    Marc

  • How to Suppress Report Total When Using Sum on Columns & Break Formatting

    I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
    I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
    Parent Record xxxxxxxxxxxxxx
    Parent Sum $$ $$
    Child Record xxxxxxxxxxxxxx
    Child Record xxxxxxxxxxxxxx
    Child Sum $$ $$
    However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
    I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
    Thanks in advance for your help.

    Hi, and welcome!
    I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
    If you put something like the following into your report region's Region Footer:
    &lt;script type="text/javascript"&gt;
    var outertable = document.getElementById("#REGION_ID#");
    var innertable = outertable.getElementsByTagName("TABLE")[1];
    var rs = innertable.rows;
    var lastrow = rs[rs.length-1];
    if (lastrow.cells[0].innerHTML == '&lt;b&gt;TOTAL&lt;/b&gt;')
    rs[rs.length - 1].style.display = "none";
    &lt;/script&gt;Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
    The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
    Andy

  • How can I get the second group and report totals in Matrix report?

    Hi,
    I have created a matrix report with 2 break Groups.
    Iam getting columns totals for the first group, but not for the second group and the report totals.
    How can I get the second group and report totals for each month?
    Thanks.
    Ram.

    Hi Ram,
    If you want a total at any group-level, go to the particular group in the data model, insert a summary column in the group, and select
    Reset At > appropriate Group Name
    For report level summaries, you must create the summary column outside of all groups.
    Navneet.

  • How to put "report total:" line in bold

    I have a report with sums. How can I specify to show the "report total:" line in bold?

    I have a report with sums. How can I specify to show
    the "report total:" line in bold?How are these sums being created? In other words, are you creating a calculation for each row in your query so you have a column of total values or is this a grouping sum calculation in your query? Or are you just using the sum checkbox on a report column in the Report Attributes definition page?
    When I use the latter HTML DB automatically adds a bold tag for me. Might have to do with the theme I'm using (theme 9).
    Anyway, there are probably a number of ways of accomplishing this. If the totals are in one of your columns you can add the font-weight:bold style to that column using the CSS Style setting for the column attributes. The most likely will probably be a CSS tweak.
    Take a look at your page source and see what class is being used for the totals and then we can see if we can tweak the CSS to make this happen.
    Earl
    Message was edited by:
    Earl

  • Hide zero report total

    Hello guys,
    it's possible to hide every zero "0" in the report total row?
    I'm using apex 4.0.1
    Thnx in advice

    Raul,
    if I understand correctly then problem is when in reports attribute you choose to have a sum column, and then at the end of report you get additional row with "report total". In that case you get 0 if all values in column are nulls.
    What you could do is following:
    In reports region definition set STATIC ID for that region, for example MYTABLE
    a) If you have a report with Pagination
    Under Section Header and Footer, you add in Footer following:
    <script>
    $('#MYTABLE tr').eq($('#MYTABLE tr').length -3).attr('id','LastRow');
    $('#LastRow td').filter(function() {return $(this).text() == '0';}).css('font-size','0%');
    </script>
    b) If you have a report without pagination then you add under footer following:
    <script>
    $('#MYTABLE tr:last').filter(function() {return $(this).text() == '0';}).css("font-size","0%");
    </script>
    You can check for example on http://apex.oracle.com/pls/apex/f?p=60428:3
    Just some quick explaination:
    In case when there is no pagination (b), I just search for last row in table and do an exact search for value 0, and then hide this value.
    In case with pagination (a), the last row is actually row where you see pagination info, and thats why you have to move up.
    In this case I search for "the real last row" and I set an id for that row. Then I just search for 0 (exact) in that row and hide it.
    Regards,
    Aljaz

  • Rounding of a total with a percent calculation

    Post Author: jdomkus
    CA Forum: Formula
    I have a sales field that is taking .10 of the total and placing that total into a new field. This figure is then being used in a total calculation with other values.  My problem is the calculation is not being handled correctly  due to the percent field total (This is complex to explain but easy to show in a example.
    total sales = .25 (Cents)  This total is being multiplied by .10 to figure out 10% of the total sales = .03 (This calculation is correct)
    Then when I go to subtract .25 - .03 = .23 (Which is not correct, rounding is set to 0.01 on the field)
    I have this report in 8.5 with all the patches and I have also download crystal report 11 with the same result, Any help would be appreciated

    Post Author: SKodidine
    CA Forum: Formula
    For Total Sales, try
    round(0.25 * 0.10,2)
    Then when you subtract it from 0.25 it should give you 0.22 instead of 0.23.

  • How to make query base delivery monthly report  link with delivery return

    Hi,
    I have facing some problem in Sales delivery report monthly. Problem is:
    1) When i make Monthly query delivery report without any delivery return and AR Credit memo, it is Fine.
    2) When i make Monthly query delivery report with any delivery return and AR Credit memo, it is not showing proper. Its showing in report including return quantity or AR Credit memo quantity.
    So, How to make query base delivery monthly report  link with delivery return and AR Credit Memo?
    Please help me regarding this.
    Mizan
    Edited by: mizan700 on Dec 18, 2010 2:50 PM
    Edited by: mizan700 on Dec 18, 2010 2:50 PM

    Hi,
    try this.
    SELECT DISTINCt T1.CARDCODE, T1.CARDNAME , T1.DOCNUM DELIVERY#,T1.DocStatus 'DELIVERY STATUS', T1.DOCDATE 'DELIVERY Date', T1.DocTotal 'DELIVERY Total', T3.DOCNUM Return#,T3.DocStatus 'Return Status', T3.DOCDATE 'Return Date', T3.DocTotal 'Return Total',T5.DOCNUM Invoice#,T5.DocStatus 'Invoice Status', T5.DOCDATE 'Invoice Date', (T5.DocTotal-T5.VatSum-T5.TotalExpns-T5.DiscSum) 'Total Before Discount', T5.VatSum 'Tax', T5.TotalExpns 'Freight', (T5.DocTotal - T5.PaidToDate) 'Total Payment Due', T7.DOCNUM AS 'CREDIT MEMO#', T7.DOCDATE
    FROM DBO.DLN1 T0
    INNER JOIN DBO.ODLN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN DBO.RDN1 T2 ON T2.BASEENTRY = T1.DOCENTRY
    LEFT JOIN DBO.ORDN T3 ON T2.DOCENTRY = T3.DOCENTRY
    LEFT JOIN DBO.INV1 T4 ON T4.BASEENTRY = T1.DOCENTRY
    LEFT JOIN DBO.OINV T5 ON T5.DOCENTRY = T4.DOCENTRY
    LEFT JOIN DBO.RIN1 T6 ON T6.BASEENTRY = T5.DOCENTRY
    LEFT JOIN DBO.ORIN T7 ON T7.DOCENTRY = T6.DOCENTRY
    WHERE  T1.DOCDATE >= [%0] AND  T1.DOCDATE <= [%1]
    Thanks,
    Joseph

  • Report Totals

    How do I show report totals without page totals? and how do I separate the totals some
    distance away from the column data. The data is so bunched up!

    The union does not work withi portal. What am I doing wrong. Is there a restricition within portal or some syntax issue I am unaware of
    ORA-01001: invalid cursor (WWV-11230)
    ORA-00933: SQL command not properly ended (WWV-11230)
    Failed to parse as PORTAL30 - select distinct
    It works in SQL Plus but not in portal. At the end of my two selects I have Group bys and order bys. The first select is doing my calulations
    and the second select within hte union is performing the column totals.
    Please advise
    Clinton

Maybe you are looking for

  • SB600 RAID 0 on SATA 1 & 2 with a DVD SATA on SATA 4?

    Can I have my 2 HD's connected to SATA 1 & 2 (SB600) in a RAID 0 config and also have my DVD on the SB600 (say on SATA 4)?  When I try, I no longer see the DVD reported and can't make it a boot device (which I need). Based on some reviews, it looked

  • Sd delivery unit in the material master

    Hi Good morning, I will be happey to here from you guru that how can  I set the delivery unit in the material master sales 1 view. The filed is non editable. Thanks in advance Kareena

  • Adobe form- Images based on conditions

    HI Experts, I have to put 2 logos which are based on company codes. Logo1 condition:- Standard Logo for each company code except for BREEZ, where the MAIN standard logo will be placed. Logo2 condition:-  Standard Logo for BREEZ, if other company code

  • Is is possible to pass EDI X12 GS 02 value to B2B via BPEL?

    Hello Oracle B2B Gurus, We currently have a trading partner with 900 different group ids. I have created a reference table from which I would like to pass the GS02 segment for B2B via a BPEL process. B2B would then consume the Group ID and forward th

  • The screen is only half screen

    Firefox is only half screen of a website half screen is white