Struts - Formatting date in display:column tag

Hi ,
I am using the following code to format the date in my display tag
<display:column headerClass="myclass" property="submittedDate" title="DATE SUBMITTED" decorator="org.displaytag.sample.LongDateWrapper" />     which displays the date like '12/22/2005 00:00'
I don't need this format . Instead ,I want to extend the decorator and create my own . For that , I'm using
import java.text.SimpleDateFormat;
import org.displaytag.decorator.TableDecorator;
public class DateDecorator extends TableDecorator{
     public DateDecorator(){          
          super();
          System.out.println("Date decorator constructor called...");
     public String getSubmittedDate(Object obj){
          SimpleDateFormat sdf = new SimpleDateFormat();
          sdf.applyPattern("MM/dd/yyyy");
          System.out.println("In getSubmittedDate()...");
          String date = sdf.format(obj);
          System.out.println("Formatted date is ::"+date);
          return date;
but at runtime it gives me the classcast exception saying that
class DateDecorator could not be loaded .
Kindly guide me through it .
Thanks

Decorator class that you wrote is "DateDecorator" and the decorator class that you used in the tag is "LongDateWrapper".

Similar Messages

  • Extract XML data based on column tag

    Dear All,
    i want to extract the XML data type based on column selection.
    For example:
    i have the below xml in my database stored as XMLTYPE() data.
    <c1>10</c1><c2>0011</c2><c3>DEBIT</c3><c4>USD</c4>
    i want to extract the column tag c2&c3 alone. Is there any query to extract the same.
    Waiting for your response.Thanks in Advance.

    Hi,
    How do I set the web service option up correctly?  The XMLs are being created behind the scenes on what data to be used but I don't know how to make the menu only pick the xml based on the menu option.
    I have one XML that populates the menu options and specific XML's that has the data that goes with each menu option. The menu population works great but it doesn't pull the other XML's to populate the charts. This is the part that I need help.
    How do I use the web service to fix this? Any help would be very much appriecated.  I could even send you my dashboard if it helps so you can see what I've gotten so far (it's not all prettied up yet since I wanted to see if it's doable first)
    I'm new to Xcelsius so I apologize if these are newbie questions.
    Thanks,
    Jay

  • How to use rowspan with display:column tag

    Folks,
    For displaying table in my project I am using display:table tag. Now in one of the column i need to use row span attribute. How can i use that.
    Waiting for the reply.

    i dont think u can set a rowspan in display:table !!!!

  • Show the rtf formated data from CLOB Column

    Hi all,
    is it possible to show the rtf formatted text stored in a clob column on the report generated with bi publisher?
    A step-by-step guidance wuold be nice.
    I have created with bi publisher a report, generated a data source and sql query.
    But in ms word it will not be shown as formatted. All rtf tags will be shown too.
    Regards,

    Hi Leonid,
    A) =======
    I'd be keen if someone like Tim would pick up on this and advise the full list of supported fo:instream-foreign-object content-type's that BI Publisher supports, would be nice if there was application/pdf and as you require application/rtf or similar. That way you'd just base64 encode your file in your XML output as per images like jpg/gif/png and include it in your template.
    Desirable syntax would then be like:
    <fo:instream-foreign-object content-type="application/rtf" >
    <xsl:value-of select="MY_BASE64_RTF_ELEMENT"/>
    </fo:instream-foreign-object>However thats wishful thinking as I can only see documented support for images specifically in jpg / gif / png formats.
    B) =======
    As a workaround if you have the ability to update your RTFs files (clobs) then you can just use the standard subtemplate functionality.
    In that case the approach would be:
    1. Update the RTFs (stored as clobs) to surround with template syntax:
    <?template:DefSubTemp?>
    ... your RTF doc here ...
    <?end template?>2. Take your clob and setup/upload as template (subtemplate=yes) manual or backend automate.
    3. Add the subtemplate to your main template (assuming you register under Application Object Library, code XXV8_SUBTEMP, language English and territory United States):
    <?import:xdo://FND.XXV8_SUBTEMP.EN.US?>
    <?call-template:DefSubTemp?>C) =======
    If you don't have the ability to update your RTF CLOBs and neither of the other solutions are suitable, then one of thing I thought of is on the fly conversion of the RTFs to, say, PNG and then use the image functionality to embed the image in the output. But again this may not be suitable as it will be an image not the "textual" output.
    D) =======
    All else failing you could look into the XML Publisher APIs to see if those could help.
    Hopefully something for you to think about here and get more info on.
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Data loading: formatting data for timestamp column

    Hi All,
    I have a table with a timestamp column named as created_date. I want to upload data to that table using data loading page. but there is one problem while uploading data, I have a csv file in which the created_date column data in two different format as follows ,
    09/03/2013 03:33am
    09/02/2013 03:24pm
    the above data throws an error ORA-01821: date format not recognized.
    In Data / Table Mapping page, I tried with MM/DD/YYYY HH12:MI:SS AM. What format should i use for am and pm??
    Please help me to solve....
    Thanks in advance
    Lakshmi

    I solved by using the format MM/DD/YYYY HH:MIAM.
    Thanks
    Lakshmi

  • How to use format-date with the report parameter

    Hi all,
    How to use the format-date function with this tag,
    <?param@begin:P_FROM_DATE?><?$P_FROM_DATE?>
    this form date is coming from report parameter and is coming like this 2012/11/01 00:00:00.
    So now i need this in DD-MON-YYYY fromat.I tried like this <?param@begin:P_FROM_DATE?><?$format-date:P_FROM_DATE;'DD-MON-YYYY'?>
    but its giving error. Can any one pls tell how to convert it to customized date format.
    thanks & Regards
    Srikkanth.M

    Issue solved.
    Ref this link
    XML date Format

  • Include format date inside If condition

    Hi,
    I need to format date which displays based on the IF condition.
    1.<?xdoxslt:ifelse(Current_stub_number___Local_ID46<Stub_Total___Local_ID66,' ’,G_L_Date___Local_ID18)?>
    above to display blank or date value G_L_Date___Local_ID18 based on condition which is workingfine.
    2.<?xdoxslt:ifelse(Current_stub_number___Local_ID46<Stub_Total___Local_ID66,' ’,<?format-date:G_L_Date___Local_ID18;'MM-DD-YYYY'?>)?>
    I inlcuded the format date in place of G_L_Date___Local_ID18. Which is giving error as error in expression. date format should be M/D/YYYY.
    Thanks in Advance,
    Vijay Kumar

    Sandeep,
    Thanks for providing the solution. It is working fine. How ever, I need the date to be printed as 1/24/2013. Month/day should be printed without zeros when it is single digit. If the month/day are double digit should be printed as it is
    Ex1: 1/2/2013 , Ex2: 12/24/2012 .
    Thanks,
    Vijay Vattiprolu.

  • How to call javascript function with dynamic data in display tag

    Hi,
    Iam new to pagination concept. Iam using display tag to display rows in jsp by strtus.
    I have a problem when calling the javascript function using ahref in attribute in display tag.
    <bean:define name="form1" property="EditDetails.List" id="ListDisplay"/>
    <display:table name="pageScope.ListDisplay" cellpadding="0" cellspacing="1" pagesize="10" partialList="false" size="listSize" requestURI="">
    <display:column property="poNo" href='javascript:searchEditDetails("./submitOrder.do? actionID=getMISLoadEdit&poNumberSel=<%=((com.po.bean.EditDetails)poListDisplay).getNo()%>&statusIdSelected=<%=((com.po.bean.EditDetails)ListDisplay).getStatusId()%>")'
    title="Number"/>                         
    <display:column property="strDate"title="Date" />
    <display:column property="orderValue"title="Order Value(INR)"/>
    <display:column property="stringRequestedDeliveryDate"title="Suggested Delivery Date"/>
    <display:column property="statusDescription" title="Status" />
    </display:table>
    The above code display the data in row format is working fine when I click the No It thow javascript error and its not redirecting to the other page.
    When I try this with ordinary struts its working fine the code is:
    <logic:iterate id="polist" name="Form1" property="EditDetails.List" indexId="i" type="com.bean.EditDetails">
    <tr>
    <td ><a href="javascript:searchEditDetails("./submitOrder.do?actionID=getMISLoadEdit&NumberSel=<%=((com.bean.EditDetails)polist).getNo()%>&statusIdSelected=<%=((com.bean.EditDetails)polist).getStatusId()%>")"><html:hidden name="polist" property="No" write="true" /></a>     </td>
    <td><html:hidden name="polist" property="strDate" write="true" /></td>
    <td><html:hidden name="polist" property="orderValue" write="true" /></td>
    <td><html:hidden name="polist" property="stringRequestedDeliveryDate" write="true" />     </td>
    <td><html:hidden name="polist" property="statusDescription" write="true" /></td>
    </tr>
    </logic:iterate>
    Please help me how to call javascript with dynamic data.
    Thanks in advance

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • What is data format "Hypertext Link" in column properties??

    Hi,
    What is data format "Hypertext Link" in column properties? How to use it?
    Can I use column value to navigate to other report without using "Value Interaction" in column properties.

    By changing the data format to say HTML, or Hypertext link, you can add HTML content/HTML tags within the column formula.
    You can create a column formula that would resolve into a dynamic hyperlink and pass parameters by using Go Url. Check out Chapter 11 in the Oracle® Business Intelligence Presentation Services Administration Guide
    Check out an example:
    Re: Dyanmic display of the Image Link URL
    Search the forum as well for several similar examples.

  • Formatting a date inside a colum tag

    Hi eveyone
    I am trying to format the column of a table so that the date will display in a certain format.
    The code that I use is doing nothing - apart from staring at me!!
    This is the snippet...
    <display:column property="departDate" sort="true"
             headerClass="sortable"
            paramId="departDate" paramProperty="departDate"
            title="Depart Date"
            class="departDate">
            <fmt:parseDate value="${departDate}" type="date" pattern="dd/mm/yyyy" var="parsed" />
            <fmt:formatDate value="${parsed}" type="date" dateStyle="full"/>       
        </display:column>Regards

    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class DateFormatter {
         public static void main(String[] args) {
              Calendar calendar = new GregorianCalendar();
              double[] limits = {1, 2, 3, 4, 21, 22, 23, 24};
              String[] dateFormats = {"st", "nd", "rd", "th", "st", "nd", "rd", "th"};
              ChoiceFormat choiceFormat = new ChoiceFormat(limits, dateFormats);
              String dateFormat = "EEEEE dd''{0}'' MMMMM";
              MessageFormat messageFormat = new MessageFormat(dateFormat);
              messageFormat.setFormat(0, choiceFormat);
              Object[] msgArgs = {
                   new Integer(calendar.get(Calendar.DATE))
              String message = messageFormat.format(msgArgs);
              System.out.println(message);
              SimpleDateFormat date = new SimpleDateFormat(message);
              System.out.println(date.format(calendar.getTime()));
    }

  • Matrix report data with summary column in excel format

    Hi ,
    I want to display output of matrix report with summary column in excel format.
    I have tried using spreadsheet but column header and actual data is displaying in proper order.
    Please tell me the way how to do this ASAP.
    Thanks in advance.

    Hi ,
    I want to display output of matrix report with summary column in excel format.
    I have tried using spreadsheet but column header and actual data is displaying in proper order.
    Please tell me the way how to do this ASAP.
    Thanks in advance.

  • Is there a way to format the way dates are displayed?

    ive got a query that returns dates. Currently, the code is:
    SELECT uptd.delivery_month delivery_time
    FROM USER_pwr_term_data uptd
    WHERE uptd.eff_date='07/JUN/02'
    the data in the database is listed in the format of 07/01/2002 and cannot be changed.
    the output from the query is coming out as 2002-07-01 0:00:00
    i am looking for the output date to be simply Jul-02 or something to this effect.
    Thanks,
    Jared

    In the group by and order by clauses, you need to use whatever to_char format that you want to group by and order by. For example, if you want to order by the year, then the numerical month, then use to_char and 'YYYY-MM'.
    If you want to display the column in the select clause in a different format than what you group by and order by, then you need to wrap an additional to_date around the format that you used for group by and order by, to convert it back to a date format, and another to_char around that, to convert it to the format you want to display it in. For example, if you want to display it like Jul-02, where 02 represents the year 2002, then use to_char and 'Mon-YY', wrapped around the to_date, wrapped around the format you used in the group by and order by clauses.
    Please see the example below. Also, notice that how the date is displayed by default, is dependent upon the nls_date_format. Also, notice that every value of eff_date that I entered is the same, despite the fact that I entered it in various formats, because I used to_date.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'
      2  /
    Session altered.
    SQL> SELECT SYSDATE FROM DUAL
      2  /
    SYSDATE
    2002-06-24
    SQL> CREATE TABLE user_pwr_term_data
      2    (delivery_month DATE,
      3     eff_date       DATE)
      4  /
    Table created.
    SQL> INSERT INTO user_pwr_term_data
      2  VALUES (SYSDATE, TO_DATE ('06/07/2002', 'MM/DD/YYYY'))
      3  /
    1 row created.
    SQL> INSERT INTO user_pwr_term_data
      2  VALUES (SYSDATE + 30, TO_DATE ('07/JUN/2002', 'DD/MON/YYYY'))
      3  /
    1 row created.
    SQL> INSERT INTO user_pwr_term_data
      2  VALUES (SYSDATE - 30, TO_DATE ('07/Jun/2002', 'DD/Mon/YYYY'))
      3  /
    1 row created.
    SQL> INSERT INTO user_pwr_term_data
      2  VALUES (SYSDATE + 31, TO_DATE ('06/07/2002', 'MM/DD/YYYY'))
      3  /
    1 row created.
    SQL> INSERT INTO user_pwr_term_data
      2  VALUES (SYSDATE - 31, TO_DATE ('06/07/2002', 'MM/DD/YYYY'))
      3  /
    1 row created.
    SQL> COMMIT
      2  /
    Commit complete.
    SQL> SELECT * FROM user_pwr_term_data
      2  /
    DELIVERY_M EFF_DATE
    2002-06-24 2002-06-07
    2002-07-24 2002-06-07
    2002-05-25 2002-06-07
    2002-07-25 2002-06-07
    2002-05-24 2002-06-07
    SQL> SELECT      TO_CHAR (TO_DATE
      2                  (TO_CHAR (uptd.delivery_month, 'YYYY-MM'),
      3                'YYYY-MM'), 'Mon-YY') AS delivery_time,
      4              COUNT (*) AS total -- or other group function
      5  FROM        user_pwr_term_data uptd
      6  WHERE       uptd.eff_date = TO_DATE ('07/JUN/2002', 'DD/MON/YYYY')
      7  GROUP BY TO_CHAR (uptd.delivery_month, 'YYYY-MM')
      8  ORDER BY TO_CHAR (uptd.delivery_month, 'YYYY-MM')
      9  /
    DELIVE      TOTAL
    May-02          2
    Jun-02          1
    Jul-02          2

  • Turn all format (data, columns, rows) from english to chinese?

    Is there any possibilities that OBIEE report can be turn into Chinese language. I mean a function that can change all english format (data, colums, rows, etc) into chinese especially mandarin. Right now, what I found is that I need to find the chinese translation for all the english terms used in the report and convert them one by one.

    Hi,
    translating column names can be done using "Externalizing Display Names":
    http://oraclebizint.wordpress.com/2007/10/29/oracle-bi-ee-101332-presentation-layer-translation/
    translating report captions can be done by using language dependent captions:
    http://oraclebizint.wordpress.com/2007/10/19/oracle-bi-ee-10133-presentation-catalog-captions/
    translating data in your tables can be done by snowflaking a translation table on your dimension tables.
    Regards,
    Stijn

  • Not able to display data in different columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • Not able to display data in separate columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
    This is an urgent need. Please help me out.

    Hi,
    I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
    eg:
    select
    case
    TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2)
    = :P15_EV_LCL
    then
    span style="background-color:lightgreen"
    || TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    else
    span style="background-color:yellow"
    || TRUNC(
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    end "Effort"
    from actuals Z
    If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
    Please suggest
    Thanks
    Sudhir
    Edited by: Sudhir_N on Mar 23, 2009 10:00 PM

Maybe you are looking for