Placing Subtotals within a Table - assistance needed!

Hi Experts,
I have a requirement for a change in a report that is created using XML Publisher and the output is from Release 12.
There are a table of values where the output presently looks like this (not every column included, to ease clarity):
Payee     Site     Amount Discount Payment Total Payable
GROUP A     MILTON KE .00     70.50     .00     70.50
GROUP A     MILTON KE .00     483.06     .00     483.06
GROUP B     DIRECT DE .00     209.40     .00     209.40
GROUP B     DIRECT DE .00     209.40     .00     209.40
GROUP A     MILTON KE .00     141.00     .00     141.00
GROUP B     DIRECT DE .00     172.98     .00     172.98
GROUP B     DIRECT DE .00     244.65     .00     244.65
GROUP A     MILTON KE .00     512.95     .00     512.95
Totals          GBP     40,519.87     .00     .00     40,519.87     .00     40,519.87
The code for this presently is:
<?for-each:PARENT?>
-- Output each row with the fields listed in table
<?end for-each?>
-- The output the Final Totals row (this is not a calculated total, but a total field listed in the XML output)
An example of the XML is:
- <PARENT>
<PARTY_SITE_NAME>MILTON KEYNES</PARTY_SITE_NAME>
<PAYEE>GROUP A</PAYEE>
<INVOICE_NUM>A10008075</INVOICE_NUM>
<DUE_DATE>19-SEP-07</DUE_DATE>
<AMOUNT_REMAINING>739.92</AMOUNT_REMAINING>
<WITHHELD_AMOUNT>0</WITHHELD_AMOUNT>
<DISCOUNT_AMOUNT>0</DISCOUNT_AMOUNT>
<INTEREST_AMOUNT>0</INTEREST_AMOUNT>
<PAYMENT_AMOUNT>739.92</PAYMENT_AMOUNT>
<AMOUNT_REMAINING_FM>739.92</AMOUNT_REMAINING_FM>
<WITHHELD_AMOUNT_FM>0.00</WITHHELD_AMOUNT_FM>
<DISCOUNT_AMOUNT_FM>0.00</DISCOUNT_AMOUNT_FM>
<INTEREST_AMOUNT_FM>0.00</INTEREST_AMOUNT_FM>
<PAYMENT_AMOUNT_FM>739.92</PAYMENT_AMOUNT_FM>
<SELECTED_PS_TOTALS>739.92</SELECTED_PS_TOTALS>
<SELECTED_PS_TOTALS_FM>739.92</SELECTED_PS_TOTALS_FM>
</PARENT>
- <PARENT>
<PARTY_SITE_NAME>MILTON KEYNES</PARTY_SITE_NAME>
<PAYEE>GROUP A</PAYEE>
<INVOICE_NUM>H10001663</INVOICE_NUM>
<DUE_DATE>07-SEP-07</DUE_DATE>
<AMOUNT_REMAINING>66.24</AMOUNT_REMAINING>
<WITHHELD_AMOUNT>0</WITHHELD_AMOUNT>
<DISCOUNT_AMOUNT>0</DISCOUNT_AMOUNT>
<INTEREST_AMOUNT>0</INTEREST_AMOUNT>
<PAYMENT_AMOUNT>66.24</PAYMENT_AMOUNT>
<AMOUNT_REMAINING_FM>66.24</AMOUNT_REMAINING_FM>
<WITHHELD_AMOUNT_FM>0.00</WITHHELD_AMOUNT_FM>
<DISCOUNT_AMOUNT_FM>0.00</DISCOUNT_AMOUNT_FM>
<INTEREST_AMOUNT_FM>0.00</INTEREST_AMOUNT_FM>
<PAYMENT_AMOUNT_FM>66.24</PAYMENT_AMOUNT_FM>
<SELECTED_PS_TOTALS>66.24</SELECTED_PS_TOTALS>
<SELECTED_PS_TOTALS_FM>66.24</SELECTED_PS_TOTALS_FM>
</PARENT>
My requirements for this are:
1) To sort the table by Payee, grouping similar Payees together. This I have achieved by adding the below after <?for-each:PARENT?>.
<?sort:PAYEE?>
2) With the Payees grouped, to add a subtotal of each of the groups WITHIN the main table, something like this:
Payee     Site     Amount Discount     Payment      Total Payable
GROUP A     MILTON KE .00     70.50     .00     70.50
GROUP A     MILTON KE .00     483.06     .00     483.06
Subtotal= 553.46
GROUP B     DIRECT DE .00     209.40     .00     209.40
GROUP B     DIRECT DE .00     209.40     .00     209.40
Subtotal= 418.80
..etc
Totals          GBP     40,519.87     .00     .00     40,519.87     .00     40,519.87
I am having trouble with getting this subtotal of each group to be within the table. My Psuedo-code I was thinging of was:
Declare variable sub_total = 0
Declare variable temp
For-Each Row
temp = this_row_payee
if(temp = next_row_payee) then
sub_total = sub_total + Total_Payable
Output this row
else
Output the subtotal
temp = next_row_payee
sub_total = 0
end if
End For-Each Row
I have tried using the for-each-group and using the Sum with current_group() but I am new to XML Publisher and would greatly welcome any feedback.
Thanks!
Mark

I have solved it, many thanks for your reply which has provided me with the solution.
<?for-each-group:PARENT; PARTY_NAME1?>
<?sort: PARTY_NAME1?>
<?for-each: current-group()?>
-- Then list the placeholder fields e.g.
<?PARTY_SITE_NAME?>
<?INVOICE_NUM?>
... etc
<?end for-each?>
<?sum (current-group()/TOTAL_PAYABLES)?>
<?end for-each-group?>
This sorts the Payees into alphebetical order and then groups, then lists every row within the group, then and at the end of the group, the total pyables field is added up and provided as a subtotal.
Thanks,
Mark

Similar Messages

  • Loop at Conditions within internal table

    I have not been ABAPing long so primarily have been using keyword help...
    I am trying to loop round an itab and only select and process unique keys from within the table!
    However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.
    So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.
    So there would only be two unique appliances I need to extract the records for.
    Basically I am trying to do something like this:
        LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID.
    Is there a way to select each unique occurrence?

    Basically, I use the COLLECT statement when I need to get the unique field (character only) field from the internal table.
    Create a table with only one field, GUID.
    LOOP through your main table, assign its GUID to new table's field GUID
    Use COLLECT new_table.
    Other option is,
    Sort the table by GUID
    Loop through it and use AT NEW GUID or AT END OF GUID
    Fill out the table with this GUID.
    Regards,
    Naimesh Patel

  • Drag and drop row within same table.

    Version 12.1.2
    I am trying to implement drag and drop row within same table, and I am trying to follow this sample from Frank:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/106-reorder-table-rows-1921121.pdf
    But, I am getting this cast exception. The code I have in my dropEvent bean is identical to whats on the sample.
    oracle.jbo.server.ViewRowImpl cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1
    Not sure if anything has changed on 12c release, or if I am missing anything.
    Here is my complete code:
    public DnDAction doDnD(DropEvent dropEvent) {
    RichTable table = (RichTable) dropEvent.getDragComponent();
    List dropRowKey = (List) dropEvent.getDropSite();
    if (dropRowKey == null) {
    return DnDAction.NONE;
    Transferable t = dropEvent.getTransferable();
    DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
    RowKeySet rks = t.getData(df);
    Iterator iter = rks.iterator();
    List draggedRowKey = (List) iter.next();
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    Row dragRow = draggeRowNode.getRow();
    JUCtrlHierNodeBinding dropRowObject = (JUCtrlHierNodeBinding) table.getRowData(dropRowKey);
    Row dropRow = dropRowObject.getRow();
    //get the table's ADF JUCtrlHierBinding
    CollectionModel collectionModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
    DCIteratorBinding objectsIterator = treeBinding.getDCIteratorBinding();
    RowSetIterator rsi = objectsIterator.getRowSetIterator();
    int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
    dragRow.removeAndRetain();
    rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
    objectsIterator.setCurrentRowIndexInRange(indexOfDropRow);
    AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
    adfctx.addPartialTarget(table.getParent());
    return DnDAction.MOVE;
    It does not seem to like this line of code:
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    I would greatly appreciate any help.
    Thanks.

    Well there has bee a changes somehow. using 12c
    table.getRowData(draggedRowKey);
    returns a ViewRowImpl and no longer anything which can be convertet to JUCtrlHierNodeBinding. Anyway, the fix is easy:
        public DnDAction onDepartmentsRowDrop(DropEvent dropEvent) {
            //get the table instance. This information is later used
            //to determine the tree binding and the iterator binding
            RichTable table = (RichTable) dropEvent.getDragComponent();
            List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if (dropRowKey == null) {
                return DnDAction.NONE;
            //The transferable is the payload that contains the dragged row's
            //row key that we use to access the dragged row handle in the ADF
            //iterator binding
            Transferable t = dropEvent.getTransferable();
            //get the row key set of the dragged row. The "rowmove" string is the
            //discriminant defined on the drag source and the collectionDrop target.
            DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
            RowKeySet rks = t.getData(df);
            Iterator iter = rks.iterator();
            //for this use case the re-order of rows is one-by-one, which means that the rowKeySet
            //should only contain a single entry. If it contains more then still we only look at a
            //singe (first) row key entry
            List draggedRowKey = (List) iter.next();
            //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
            Object objdrop = table.getRowData(dropRowKey);
            Row dropRow = (Row) objdrop;
            //get the table's ADF JUCtrlHierBinding
            CollectionModel collectionModel = (CollectionModel) table.getValue();
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding departmentsIterator = treeBinding.getDCIteratorBinding();
            RowSetIterator rsi = departmentsIterator.getRowSetIterator();
            int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
            //remove dragged row from collection so it can be added back
            dragRow.removeAndRetain();
            rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
            //make row current in ADF iterator.
            departmentsIterator.setCurrentRowIndexInRange(indexOfDropRow);
            //ppr the table
            AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
            //note that the refresh of the table didn't work when refreshing the table
            //so I needed to refresh the container component (af:panelStretchLayout).
            adfctx.addPartialTarget(table.getParent());
            return DnDAction.MOVE;
    does the trick. I changed the line to
    //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
    so you don't need the detour through the JUCtrlHierNodeBinding any longer.
    Timo

  • Placing Images within Content

    Is this the correct method for placing images within the content?
    <img src= "img/204point.jpf" alt="204 Point System" />
    or is there a better method using CSS?
    This is not a background image, it is just an image amongst the text.

    Yes, that's the correct way, although .jpf is not a recognized extension for images. I assume it's a typo for .jpg. Also, the width and height of the image should be included. Dreamweaver should detect these automatically for you.
    Images are considered inline elements, so you normally need to use CSS to float them left or right to flow the text around them. Create the following style rules in your style sheet:
    .floatleft {
      float: left;
      margin-right: 8px;
    .floatright {
      float: right;
      margin-left: 8px;
    Select the image, and apply floatleft or floatright from the Class menu in the Property inspector.

  • Insert row wherever within a table?

    Can it be done? Looking to add and delete rows wherever needed within a table. Currently, it only allows me to add or remove either the very first row or the very last; not those in-between. My users constantly request the ability to insert where needed (like word and excel) and I'm stumped on how to work it out.

    1. Cell options
    2. Cell options!
    You probably have too much space inside the top and bottom edges of each cell. Select the entire table and select Cell Options (from the Table menu or from your friendly right click pop-up menu). A relatively safe value for Top and Bottom distance is 1 mm.
    You can see the grid lines either because you have Show Frame Edges on (they should be thin and blue), or, more likely, because the ID import doesn't honor the Excel settings and puts the lines there by itself. If your lines are blue and thin, don't worry; they're just there to help you. Select Preview mode and they will disappear (just as text frame edges, guidelines, etc.). If the lines are black and thick, select the entire table and use the Cell options to switch them off. Just select either 0 pt thickness or a [None] line color.

  • Drag a column from one position to another within the table.

    Hello All,
    In Web Dynpro Java, Is it possible to provide user a functionality with which he/she can move the columns of a table from one position to another ?
    Scenario : Users want flexibility to decide the location the columns as per their convinience while they are working with the application.
    So can we develop some code or can we use some UI element so that user is able to drag a column from one position to another within the table.
    Regards
    Mrinalini.

    Hi Mrinalini,
    Yes this is possible you can try to move the table columns (Change the order). for this you don't need to do additional coding or property change its a default property for web Dynpro java tables.
    Regards
    Jeetendra

  • Applet within a table tag.

    Hi,
    I have placed an applet within a <table> tag. The applet does not get executed. I see only blank space, even though the HTML source has the applet tag. If I remove the table tags and place the applet directly in <body>, then it works fine. So there isnt any problem with the codebase or anything.
    Are there any specific rules as to inside which tags can the <applet> tag be embedded? I would apprecite any information regarding this.
    Thanks,
    RG

    This is my html file:
    <table>
         <tr>
              <td>
                   <applet code="test" />
              </td>
              <td>
                   <object ID='jsApplet' classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" >
                      <param name="code" value="test.class" />
                    </object>
              </td>
              <td>
                   <DIV id="dvObjectHolder">Applet comes here</DIV>
              </td>
         </tr>
    </table>
    <script>
    if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
         document.getElementById('dvObjectHolder').innerHTML = "        <object ID='jsApplet' classid=\"java:test.class\"" +
                    "height=\"0\" width=\"0\" onError=\"changeObject();\"" +
              ">" +
                    "<param name=\"mayscript\" value=\"Y\">" +
            "</object>";
    }else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
         document.getElementById('dvObjectHolder').innerHTML =      "<object ID='jsApplet' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
                   "         height=\"0\" width=\"0\" >" +
                   "   <param name=\"code\" value=\"test.class\" />" +
                   " </object>"
    </script>this is my applet
    public class test extends java.applet.Applet implements Runnable{
         public test(){
              // run it as an applet or run it as an application
              new Thread(this).start();
         public void init(){
         public void run(){
              System.out.println("applet started");
         public static void main(String[] args) {
                   // run it as an applet or run it as an application
                   new test();
    }I open the html file with IE6 and have no problem.

  • How to move a column within a table?

    Hi All!
    Is it possible in Oracle 9i to move a column within a table? For instance, I have a table
    ID1 ID2 ID3 SRC_ID1 SRC_ID2 SRC_ID3
    and I want to add one more column ID4. So, I can do it like this:
    ALTER TABLE MY_TABLE
    ADD ID4 NUMBER(18);
    In this case, the column will be added to end of the table but I want to move the column on the position after ID3. So, my question is, is it possible to move a column within a table? And if yes, how I can do it?.
    Any help will be appreciate.
    With best regards,
    Andrej Litowka.

    Hi,
    Actually speaking it makes no difference where a column is placed in the table. The select clause is the one that decides on how to display the data. But still if you want to store it next to a particular column then there are 2 options...
    1. Rename &lt;tname&gt; to &lt;tname_1&gt;;
    Create view &lt;tname&gt; as select &lt;cols&gt; from &lt;tname_1&gt;;
    The above option is useful in case of selects. In case of DMLs it will have to do a little more work by going and firing the same on the actual underlying table.
    2. Rename &lt;tname&gt; to &lt;tname_1&gt;;
    Create table &lt;tname&gt; (&lt;new col order with the new col&gt;);
    Insert into &lt;tname&gt; (select &lt;col order&gt; from &lt;tname_1&gt;);
    This option seems to be better than the first one.
    Hope this helps you.
    Regards,
    DJ

  • Authorization issue within a table in BI

    Hello All,
    Here is my authorization issue :
    We have set up an authorization on infoobject Zapplication. End user is allowed to choose "HR" only.
    In Rsecadmin, infoObject Zapplication is restricted to "HR"
    Then, this authorization object has been assigned to end user.
    This user go to a specific table to select an application and a date.
    When user display the possible value he only see "HR". Which means our authorization is correct.
    However, this user can enter another value such as "SD". This value does exist in infoObject Zapplication. So, it means that there is an issue with our authorizations settings.
    We have added a control table, it's even worse in this case, authorization are not checked at all and all available values are displayed.
    Any idea to prevent the user to entered a value within this table ?
    Why our authorization does not check the value entered directly in the table ?
    Thanks &
    Regards
    Cath

    Hello
    For info we manged to restrict acces on this table by using event table from table maintenance and we have combined it with a specific authorisation object.
    Regs
    C.

  • In smartform : in a  table i need to maintain  fixed no of rec

    .2.in smartform in a table i need to maintain  fixed no of records in each page i.e 10 records in each page and after printing 10 records page break has to occur and print them in New page , how to do this can any body help me.in each page i.e 10 records in each page and after printing 10 records page break has to occur and print them in New page , how to do this can any body help me.

    Hi,
    I dont know if there is any direct way of doing so, but ican suggest a turn around solution.
    declare 2 global tables 1. ITAB_10 type ITAB (in which there is ur data)
                                      2. IT_ROW inwhich 2 cloumn (start_pos & end_pos type i)
    Now in intialization.
    Caluculate no of rows in ITAB.
    Say there are 56 rows, then fill table it_row as 1(start_pos) - 10(end_pos), 11-20,...51-56.
    Then in main Window, Create a loop on IT_ROW.
    in that create a CODE under this loop in which fill ur ITAB_10 from ITAB as per start_pos& end_pos in IT_ROW.
    Then create TABLE under the loop, for ITAB_10.
    Regards,
    Vaibhav.

  • How can I make the GRID lines more bold within a table in the new Pages?  (Not the outline of a table)

    I can't find where to darken GRID lines on a table in the new Pages.  I can make the outline more bold, but not the grid lines within the table.  Is there a way to do this?  The default grid lines are far too faint.

    Yeah, the Help is missing a little.
    If you select the block of cells that you want to change, then in the Format inspector:
    Select the Cell tab
    Expand the Border section
    Set a line type
    Set a line width
    Choose a line color
    Choose one of the nine options for which borders get the new settings

  • Error in Creating Advance table within Advanvce Table via view link

    Hii all,
    i hve created a Advance table within Advanvce Table as given in the developer guide using the Detail functionality of the advance table
    im facing the following error................
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.apps.fnd.framework.webui.OAAdvancedTableHelper.updateInnerTableProperties(OAAdvancedTableHelper.java:1752)
    i hve done all the steps as suggested by gurus to implement this Master Detail functionality. Pl help me out if any one had implemented it
    thanks in advanve
    Pranav

    Hi Reetesh,
    thanks for the reply...
    I hve already created a transient attribute in Master VO attached to the outter advance table and had set this attribute in detail attribute property of outter
    advance table. But im facing the same error.
    I u hve implemented this pl let me know the correct steps
    thanks
    Pranav

  • Numbers ought to keep check box that allows carriage return within a cell universally within a table

    Apple really fell asleep at the switch when releasing its latest version of Numbers 2013 (3.2), because it ignored the universal learning styles of human beings who have used the software in earlier releases and seemed to change features with little consideration for the community as a whole.
    For example, why would you delete the feature that allows a user to turn-on or turn-off the "carriage return within a cell".  It seems smart of them to add the abilityt to simply press the Option key and hit return at the same time to allow a carriage return within a cell, but why would you DELETE the feature that allows returns within a cell universally within a table? 
    And then the Inspector got completely revised.
    Time saved in creating technologies gets eaten up in having to relearn technology every time a new release is created that doesn't build on the previous release very well.

    Adamo,
    You are complaining to fellow users.  It is best to post your feedback to Apple using the menu item
    "Numbers > Provide Numbers Feedback"

  • My BB9810 refuse to load OS7.1 software on my phone after the download has completed. My phone has freezed/stucked since morning. Pls urgent help/assistant needed as I can not access/use my phone for over 24hrs now.

    My BB9810 refuse to load OS7.1 software on my phone after the download has completed. My phone has freezed/stucked since morning. Pls  urgent help/assistant needed as I can not access/use my phone for over 24hrs now.

    Hi there,
    Use the method described in the link below to get back up and running:
    http://supportforums.blackberry.com/t5/Device-software-for-BlackBerry/How-To-Reload-Your-Operating-S...
    I hope this info helps!
    If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.
    If your issue is resolved, don't forget to click the Solution button on the resolution!

  • Style sheet changing when applied to text within a table

    Hi everyone,
    I'm using ID CS2.
    I've defined a paragraph style sheet with the regular weight of a certain typeface, however when I apply this style to text within a table, the typeface changes to the bold version of the font even though the regular version is specified in the style.
    Does anyone know if this is a known issue with styles being applied to tables or is it a sign of a corrupt file or something? Is there a fix?
    Thanks

    Is there a character style applied to the table or text in the table. I had many issues with this over-riding my paragraph style.

Maybe you are looking for

  • Problem with Beansbinding as separated class

    Hello, I used beansbinding together with a JTextfield and usually it works, which means that if I do it like the following;   /// the class that I use implements a binding listener binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_

  • Reader

    Hi I downloaded reader for my MAC  I can only open PDF's in Safari and not firefox  what can I do to fix this??

  • 'Pass Through' Chapter Select Menu Text

    Hi there, I'm putting together a DVD using the Pass Through theme, but seem to hit a snag with the chapter menus - namely that I can't stop the background text from saying "PASS THROUGH CHAPTERS". Whilst looking very nice, it's not actually what I wa

  • My iTunes is disabled

    I have 2 iPod shuffles, iPod, 1 iPad 2, iPhone 4S and just added the iPad 4 to my iTunes account.  It is now saying my iTunes account is disabled.  I can't update any of my apps or add new music.  I have deleted my password and created a new one.  I

  • Outlook Anywhere office 2013 gets dissabled even though group pollicy is set to force proxy settings.

    Domain joined laptops have outlook anywhere settings forced through group policy.  Running gpresult command shows correct group policy are applied. GPO: Outlook Offsite Settings                 Folder Id: Software\Policies\Microsoft\Office\12.0\Outlo