Skip to Content
author's profile photo Former Member
Former Member

transform java into CR code

Hi everybody,

has anybody an idea, how to realize this: "+new SimpleDateFormat("MMMM yyyy").format($P{MONTH_YEAR} -28)

in CR?

based on this java I think: new java.util.Date()

rgds

Eberhard

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 15, 2016 at 09:48 AM

    Hi Eberhard,

    Below is the explanation for the code :

    "+new SimpleDateFormat("MMMM yyyy").format($P{MONTH_YEAR} -28)

    It is try to display the date in 'MMMM yyyy' format after manipulating MONTH_YEAR by reducing 28 days.

    so, formula would be :

    Totext((Month_Year)-28,"MMMM yyyy")

    Thanks,

    Sastry

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 15, 2016 at 09:11 AM

    Hi Eberhard,

    I cannot say for certain what that piece of Java code does, however, it seems to me that it displays dates in a particular format - in this case MMMM yyyy.

    The CR alternative for that would look like this:

    ToText({Date field}, 'MMMM yyyy')

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

    • Yes, you're almost correct.

      The Crosstab is set to display by month, however, the chart only seems to display a specific month.

      If the chart is supposed to display only a specific month, you'd need another crosstab with just that month's data. You can then insert a chart off of this crosstab and suppress the section that holds this new crosstab.

      -Abhilash

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.