How to do formatting of messageStyleText in a table for each row

Hello one and all,
We have a requirement that the values displayed in figures must have a formatting same as we do in SQL
for example : select TO_CHAR(4555.95 , '999,999,999.99') from dual
OUTPUT will be 4,555.95
Now i want to do the formatting for the messageStyleText which i have created as follows:
Header
Table
messageStyleText
The code that i am writing is as follows :
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
//Call the AM by using create object, this object created only for FirstPG_AMImpl use
FirstPG_AMImpl am =(FirstPG_AMImpl)pageContext.getApplicationModule(webBean);
//Calling view object vo method when Go button is clicked.
if (pageContext.getParameter("go")!=null)
Object [] returnVa = (Object[]) am.payslipsummary(pageContext);
OAMessageStyledTextBean earbean =(OAMessageStyledTextBean) webBean.findIndexedChildRecursive("inputValue");
earbean.setValue(pageContext, returnVa[0]);
when the query executes it displays 3 Rows in the table.
Now, the formatting happens only for the first row displayed in my table. how to allow formatting to happen for all the rows???
NOTE: the formatting code is in my AMImpl
public Object[] payslipsummary(OAPageContext pageContext)
Object [] strValue = new Object[10];
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMinimumFractionDigits(2);
numberFormat.setMaximumFractionDigits(2);
numberFormat.setMinimumIntegerDigits(3);
numberFormat.setMaximumIntegerDigits(20);
return strValue;
pls help!
Brgds,
Jenny

Hi,
To for the specific column value of all rows of table, please loop through the underlying VO of that table
OAViewObject vo = (OAViewObject)am.findViewObject("View Object");
if (vo != null) {
Row TotalLinesVOrows[] = vo.getAllRowsInRange();
RowSetIterator rowsetitr[] = vo.getRowSetIterators();
if (vo.getRowCount() > 0) {
rowsetitr[0].setRangeStart(0);
rowsetitr[0].setRangeSize((int)vo.getRowCount());
for (int count = 0; count < vo.getRowCount(); count++) {
row = rowsetitr[0].getRowAtRangeIndex(count);
Object value= row.getAttribute("ViewAttributename");
Double fomattedValue=getFormatCurrency(value)
row.setAttribute("ViewAttributename", fomattedValue);
public String getUSFormatCurrency(double value)
Locale locales = Locale.US ;
DecimalFormat formatter = (DecimalFormat)
NumberFormat.getCurrencyInstance(locales);
String formattedCurrency = formatter.format(value);
return formattedCurrency;
Thanks
Pratap

Similar Messages

  • How do I save rows results and add them up for each row.

    I have the following select statement that saves the results in result1, result 2 and result3 variables.. How do I include a total (result1 + result2 + result3) for each row?
    select TRUNC(AVG( SUM ( (DECODE (cc.request_wflow_status, 'Estimator Notified'
    ,cc.end_date,NULL) - DECODE (cc.request_wflow_status,
    'Estimator Notified',cc.start_date,NULL)))),1) result1
    ,TRUNC(AVG( SUM ( (DECODE (cc.request_wflow_status, 'Estimator Accepted'
    ,cc.end_date,NULL) -
    DECODE (cc.request_wflow_status,'Estimator Accepted',cc.start_date,NULL)))),1) result2
    ,TRUNC(AVG( SUM ( (DECODE (cc.request_wflow_status,
    'Install Complete',cc.end_date,NULL) -
    DECODE (cc.request_wflow_status,'Install Complete',cc.start_date,NULL)))),1) result3
    FROM cc_request_status cc
    GROUP BY cc.request_id
    Thanks,

    select result1,result2,result3,nvl(result1,0) + nvl(result2,0) + nvl(result3,0) Total from ( ...your query...);

  • How to find total recs in a local table for a particular condition

    Hi,
    How to find total recs in a local table for a particular condition?
    Thanks,
    CD

    Well, you may want to try this as well, and compare to the LOOP way.  Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it.  Again I think there may be some overhead in doing the copy.  Next, delete out all records which are the reverse of your condition.  Then whatever is left is the rows that you want to count.  Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
    data: itab type table of ttab.
    data: itab_tmp type table of ttab.
    itab_tmp[] = itab[].
    delete table itab_tmp where fld1 <> 'A'.
    lv_count = lines( itab_tmp ).
    Regards,
    Rich Heilman

  • How to process a block for each row in an internal table....

    Hi experts....
    In po approval workflow the scenario is like this.... for each po there may be more than one approver. approvers list i am maintaining in the ztable. list of approvers(no of approvers) is decided by the po value. I have collected these approvers into internal table. now i have to process a block ( approving or rejecting the po... )in the workflow for each row in the internal table.
    how can i do this. based on the decision of the 1st approver  approves the po then it should go to next approver in the internal table...otherwise end the workflow.....
    Please help me......

    i have created an internal table in the workflow container in which i am getting the list of approvers....
    how can i loop the internal table in the workflow...?
    how can i know the index of the loop in the workflow.....(will sy-index work here....? so that i can use loop until step in the main workflow to call the subworkflow..so that if sy-index is greater than no of entires in the itab then i can come out of the loop)

  • How to add a comment for each row on the output of a report?

    I would like to add a comment (field) for each row on the output of report? This comment should to be saved as well. Is there a way i can do that?
    Regards,
    Ram

    Hi Dimitri,
    through the instead of trigger functionality i am able to update the view. This is view is based on different views which should be linked to a table (as you suggested) in which comments can be stored. Hower this table is empty and how to link this table with the view now? I face the following challenge.
    View consists the following columns, for example
    select name, sex, age from test_view
    name sex age
    John M 20
    Anton M 30
    Willy M 40
    shirley F 38
    sharon F 37
    The report has the following output, for example
    name     sex age
    John     M 20
    Anton     M 30
    Willy M 40
    Shirley F 38
    Sharon F 37
    Now i would like to add comment through a button.
    The report layout looks like
    name sex age
    John M 20 <add comment button>
    After submitting the <add comment button> you can enter text which deals with John
    text='John doesnot like me'
    Finally the report display the comment as well
    name sex age
    John M 20 'John doesnot like me' <update/delete comment button>
    Anton M 30 <add comment button>
    Willy M 40 <add comment button>
    Shirley F 38 <add comment button>
    Sharon F 37 <add comment button>
    After submitting the <update/delete button> you can change or delete the entered text.
    I hope this example clears things up.
    Regards,
    Ram

  • How can I add buttons that do different things to each row of an rpt result

    Hi there,
    I'm trying to figure out how to add buttons to each row of a report. Here is the scenario:
    report query returns a set of data that needs to be "approved". The options are "Append", "Replace", or "Reject" (I want to make the results look like so:)
    Person1 today blah, blah blah... Append button Replace button Reject button
    Person2 today blah, blah, blah... Append button Replace button Reject button
    PersonA today something, blah... Append button Replace button Reject button
    and so on.
    I'd like to set up the page so that there is an append, replace, reject button for each row returned by the report. So when the "Approver" clicks on the append button, something happens for that row, etc. How does one do this? So far I can only get the buttons to show up in the region. I also thought it might be possible to somehow turn the append, replace, reject text into links that called a plsql proceedure that would handle the action, but I'm not having any success with that idea either.
    Edited by: user10361829 on Sep 29, 2009 12:10 PM

    What I've done is make my report query as follows:
    select field_a, field_b, field_c, 'Append', 'Replace', 'Reject'
    from table_x
    where field y = :PX_ID
    That gives me the words (append, replace, reject) in the report. Then I go to the report attributes section and make a link out of the columns (append, replace, reject) so far, so good.
    Next question is how to make clicking on those links activate an update action on tableN. In the column_link section there is a box marked "Request" that looks like it might be relevant because Request is a term connected to buttons, but I've no idea how to use it. Or, can one use the tabluar form element section of the report attributes page to connect the Append (pseudo column) to an action? I've looked at your example (Sam) with the delete button, but what I really need to see is the Apex menu that sets it up because there are so many levels in the interface it is not intuitive (at least for me). I know exactly what I want it to look like but I'm missing the crucial step to get there... Thanks for your help so far.
    Column link section is described below :
    Column Link     Top
    Link Text      flashlight          
         [*Append*][Icon 1][Icon 2][Icon 3][Icon 4][Icon 5]
    Link Attributes      
    Target: *"Page in this application"*     Page: *10*     
    Reset Pagination
    Request Clear Cache      
    Name     Value
    Item 1      Px_page_item flashlight *#????#*          flashlight
    Item 2      flashlight          flashlight
    Item 3      flashlight          flashlight
    URL      
    Page Checksum

  • How to create DB partitioning in active data tables for ods?

    hi all,
    Can anyone let me know how to create DB partitioning in active data tables for ods. if any docs pls share with me at my email id : [email protected]
    regds
    haritha

    Haritha,
    The following steps will briefly explain you to improve the performance in terms of DB partitioning as well as loading. Please find the same,
    transaction RSCUSTA2,
    oss note 120253 565725 670208
    and remove 'bex reporting' setting in ods if that ods not used for reporting.
    hope this helps.
    565725
    Symptom
    This note contains recommendations for improving the load performance of ODS objects in Business Information Warehouse Release 3.0B and 3.1 Content.
    Other terms
    Business Information Warehouse, ODS object, BW, RSCUSTA2, RSADMINA
    Solution
    To obtain a good load performance for ODS objects, we recommend that you note the following:
    1. Activating data in the ODS object
    In the Implementation Guide in the BW Customizing, you can implement different settings under Business Information Warehouse -> General BW settings -> Settings for the ODS object that will improve performance when you activate data in the ODS object.
    1. Creating SIDs
    The creation of SIDs is time-consuming and may be avoided in the following cases:
    a) You should not set the indicator for BEx Reporting if you are only using the ODS object as a data store.Otherwise, SIDs are created for all new characteristic values by setting this indicator.
    b) If you are using line items (for example, document number, time stamp and so on) as characteristics in the ODS object, you should mark these as 'Attribute only' in the characteristics maintenance.
    SIDs are created at the same time if parallel activation is activated (see above).They are then created using the same number of parallel processes as those set for the activation. However:if you specify a server group or a special server in the Customizing, these specifications only apply to activation and not the creation of SIDs.The creation of SIDs runs on the application server on which the batch job is also running.
    1. DB partitioning on the table for active data (technical name:
    The process of deleting data from the ODS object may be accelerated by partitioning on the database level.Select the characteristic after which you want deletion to occur as a partitioning criterion.For more details on partitioning database tables, see the database documentation (DBMS CD).Partitioning is supported with the following databases:Oracle, DB2/390, Informix.
    1. Indexing
    Selection criteria should be used for queries on ODS objects.The existing primary index is used if the key fields are specified.As a result, the characteristic that is accessed more frequently should be left justified.If the key fields are only partially specified in the selection criteria (recognizable in the SQL trace), the query runtime may be optimized by creating additional indexes.You can create these secondary indexes in the ODS object maintenance.
    1. Loading unique data records
    If you only load unique data records (that is, data records with a one-time key combination) into the ODS object, the load performance will improve if you set the 'Unique data record' indicator in the ODS object maintenance.
    Hope this helps..
    ****Assign Points****
    Thanks,
    Gattu

  • How to display recordnumber for each row in cross tab?

    <p>Hi.. </p><p>I am using Crystal Report XI,with the database Microsoft SQL Server. I have 2 questions regarding Cross Tab.</p><p>1. How to limiting record per row and per column in Cross Tab? For example,at one page the report printing 20 records per row and 7 records per columns.</p><p>2. I would like to display recordnumber for each row that printing in Cross tab. How crystal reports can handle this?</p><p>Can anyone can help me out on this? </p><p>Please kindly advise.</p><p>AN </p><p> </p><p> </p>

    <p>Dear Kathryn,</p><p> </p><p>I did used DisplayString as suggested by you. The result work fine until I add more data to this cross tab. I used this formula : </p><p> global numbervar pager;</p><p>recordnumber();</p><p>pager := pager + 1; </p><p>  if pager > 0 then totext(pager - 1,0)     </p><p> </p><p>The result come out in decending order for each row. </p><p>SN    Name </p><p>5       abc<br /></p><p> 4       def</p><p>3        fig<br /></p><p>2        klm<br /></p><p>1      opq</p><p> Is that anything wrong with my formula?<br /> </p><p>Please kindly advise.</p><p>-AN- </p><p> </p><p> </p>

  • How to constuct a table with each row having a button to select

    Hi,
    Imagine i have 5 orders and i want to select one order to view or update in other page.
    How i construct a table with each row having a button to select it.
    I'm having a hard time to do this. How i select a backingBean method in Javascript?.
    Thanks

    I'm trying to put a <h:commandButton> inside <h:dataTable> like this:
                    <h:dataTable id="books" value="#{BuscarLibros.booksSearched}" var="book">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.title}"/>
                            </f:facet>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.isbn}"/>
                            </f:facet>
                            <h:outputText value="#{book.isdn}"/>
                        </h:column>
                        <h:column>
                            <h:outputFormat value="#{book.fechaPublicacion}">
                                <f:convertDateTime pattern="ddd/MM/yyyy"/>
                            </h:outputFormat>
                            <h:commandButton action="#{BuscarLibros.prepareUpdateBook}" value="Hello WORLD"/>
                        </h:column>
                    </h:dataTable>but it does not call the method.
    If it is outside it calls but inside not. Its strange because Duke's bookstore example from Sun Java EE is like that.
    Any clues?

  • How to find out exact labour hour and expenses for each labour attached to

    Team,
    How to find out exact labour hour and expenses for each labour attached to machine
    We are planning to go with CATS.
    But in Cats how Production Planning department get the exact labour coust
    (which includes labour accomodation building , EB etc. paying by comp)
    How to do this in CATS
    REX

    hai
    generally  the schemas are named X000  which stands for common schema  nomination
    x replaced by respective country like for india it is IN00  for US  U000etc
    it is not given according to the group of emplyees but according to the country grouping for your org units
    time schemas are country independent they work for all the countries
    regards
    nalla

  • I backed up two Iphones to the cloud and accidentally chose merge. How can I reset it to have seperate backups for each phone with the same ITUNES login?

    I backed up two Iphones to the cloud and accidentally chose yes to merge the contacts from the two phones. How can I reset it to have seperate backups for each phone even though I am using the ITUNES login?

    i merged two phones contracts are together how to get back to seperate

  • How do I format a new external Hard drive for Mac?

    Simple question I know for many of you out there but I could do with some advice as I have never done this before. I would like to buy a new external hard drive to store my music and photos on. I will get one with firewire and usb2 connectivity.Could someone walk me through the steps needed to format and prepare a hard drive for use with my Macbook (if it is not already Mac formatted). Will any brand of hard drive work with Mac or are some better than others?

    In addition to what Templeto Peck said, make sure that you select the formating to be OSX Extended.
    As far as the best esternal drive, type into the "Search Discussion" box: Best external hard drive. This will bring you to several previouslly posted threads that discuss quite thoroughly your question. The following is extracted from one thread:
    The best drives are those that use the Oxford 911 chipset. I like the Mercury Elite Pro drives from OWC, but there are plenty of others that use the same chipset.

  • How to activate a different sub-report for each row in the data set as main report page breaks on each row of data in the main dataset

    I am going to try asking this same question a different way as I have yet to find a working solution to my problem.  I have a main report and then 8 sub reports.  My main report has one data set and returns one row of data per account number.  One
    of the fields in the main data set is called AccountProf.  My main report displays one page per Account number and then calls a different sub report based on that account's AccountProf value.  The sub reports take in the account number as a parameter
    and get multiple rows of data to display that accounts usage formatted differntly for each AccountProf (hence the 8 different sub report.  
    So far I can figure out how to do everything but setting the visibility property of each sub-reports when I have multiple accounts.  If I use the following expression for the visibility property on each sub report, it makes all the applicable sub report
    for all the accounts requested visible at once:
    =IIF(Fields!AccountProf.Value= "USE_PLUS_DMD",False,True)
    *The value in bold USE_PLUS_DMD  is different for each sub report.
    Here is a look at what the main report look like:
    Here is the main reports data set:

    Hi JasonDWilson77,
    According to your description, there is a main report and 8 sub reports in the report, you want to set visibility of sub reports, if no value is passed to the parameter of sub report, the sub report will not be displayed. If that is the case, please refer
    to the following steps:
      1. Create a new parameter named NewAccountNumber, set its data type the same as @AccountNumber, select Allow multiple values, set Visibility to be hidden, then set all available values to default values.
      2. Right-click the first sub report and open Subreport Properties dialog box, click Parameters in left pane, set name to AccountNumber, then click (fx) button, type the expression like below:
    =Parameters! NewAccountNumber(0)
      3. Click Visibility in left pane, select Show or hide based on an expression, then click (fx) button and type the expression like below:
    =IIF(InStr(Join(Parameters! AccountNumber.Value), Parameters!NewAccountNumber.Value(0))>0 , false,true)
      4. Modify parameter of other sub reports like step2.
      5. Set visibility of other sub reports like step3.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • How to change VO's dynamically for a item for each row in advanced table?

    Hi All,
    We had a requirement to filter the employees based on the search criteria table. I am using advanced table for developing search criteria.
    In that table I am having three columns. Operator (messagechoice), Criteria Type (messagechoice), and Criteria value (messageLovInput). Also 'Add Another Row' functionality is available.
    My requirement is:
    First Row:(Initial Row)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    Second Row: (when the user selects Add Another Row button)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    The problem I am facing here is, the Criteria Value column is pointing to only one VO at design time. But wee need to change that VO dynamically without disturbing other rows depending on the Criteria Type value.
    Is it possible to do so?
    Note: User can add n number of conditions as he want.
    Can anyone help how to acheive this.
    Regards,
    Sundeep.

    Check Dynamic Poplist section under Standard Web Widgets in Chapter 4 of OA Framework Developers guide.

  • How to update a column in a nested table for a given record in the master t

    Hi I have translations for all attributes of an item stored as a nested table
    CREATE OR REPLACE TYPE T_ITM_ATTR AS OBJECT(
    ATTR_NM VARCHAR2(30),
    ATTR_VAL VARCHAR2(200 CHAR),
    ATTR_STS_BL NUMBER(1))
    INSTANTIABLE
    FINAL
    CREATE OR REPLACE TYPE T_ITM_ATTRIBUTES AS TABLE OF T_ITM_ATTR;
    CREATE TABLE XGN_MOD_ITEMS_T
    IDS NUMBER,
    MOD_IDS NUMBER NOT NULL,
    MOD_ITM_IDS NUMBER NOT NULL,
    LGG_ID VARCHAR2(3 CHAR) NOT NULL,
    ITM_TYPE VARCHAR2(50 CHAR) NOT NULL,
    ITM_NM VARCHAR2(50 CHAR) NOT NULL,
    ITM_BLOCK VARCHAR2(50 CHAR),
    ITM_ATTR T_ITM_ATTRIBUTES,
    ITM_COL1 VARCHAR2(1 CHAR),
    ITM_DSC VARCHAR2(100 CHAR),
    CREATED_BY VARCHAR2(30 CHAR) DEFAULT USER NOT NULL,
    CREATION_DATE DATE DEFAULT SYSDATE NOT NULL,
    LAST_UPDATED_BY VARCHAR2(30 CHAR),
    LAST_UPDATE_DATE DATE
    NESTED TABLE ITM_ATTR STORE AS NESTED_ITM_ATTR_T
    TABLESPACE XGN4_TAB
    PCTUSED 40
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    What I want to do is to update only the attr_val of each item to a value coming from a temporary table where the user inserted his translations
    So how can I update ?
    this doesn't work since I have to know the previous value?
    update table(
    select t2.attr_val
    from XGN_MOD_ITEMS_T t1, table(t1.itm_attr) t2
    where t1.mod_itm_ids=160) attr
    set value(attr) = 'Profil'
    where value(attr) = 'Profile'
    This updates all occurences for all entries wich doesn't work either because I have for each language another record
    UPDATE /*+ NESTED_TABLE_GET_REFS */
    NESTED_ITM_ATTR_T
    SET attr_val = 'SHIT'
    WHERE attr_val = 'Profile'

    http://www.psoug.org/reference/nested_tab.html
    Look for UPDATE. There is a working demo on the page.
    That said nested tables are not a good place to store data. Reconsider using relational tables with, if necessary, object views.

Maybe you are looking for

  • Inserting Data from one table to another.

    I running a procedure that loops through a cursor which is about 80,000 records(tableA) and I am trying to insert into another table(tableX) based on the data from tableA. I have error trapped the hell out of this and made sure I am covering any hole

  • How can I read Extended APDU input to the same buffer

    The following is the code I am currently using where inBuffer is an intermediate array of 1000 length. However, I do not want to allocate any buffers at all, and just want to send a command apdu of 1000 byte length and modify it in the code and retur

  • Sharing Music (From a 'Windows 7' Computer to an iPod Touch)

    Folks, I need some help! I'm not a big user of Apple Products - just getting started and still not sure about the technology/terminology so please forgive me if I use the wrong words! My friend has an iPod Touch (4th Generation). It's linked to her i

  • My itunes wont open at all??

    I have a windows vista and my itunes store wasnt opening due to something with my network? I checked my network and it was fine. So I downloded the newest version and it opened at first but the problem still continued. Now its not opening at all. Hel

  • Adding a new Cost Center code to a 82ax Report painter

    Hi experts, I am asked about adding Cost center code to the left of a 82a Report painter(Where the Pepe element code and description is) without modifying the actual length of that colum.... Is this possible?? Thank you very much. Artur.