Jump to content

victorlizonglin

Members
  • Posts

    21
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by victorlizonglin

  1. OK, nobody answer that, then I found the solution.

    -----------------------------------------

    Step 1: Create the Parameter1, the class is "java.text.DateFormat"

     $P{REPORT_FORMAT_FACTORY}.createDateFormat("MM/dd/yyyy HH:mm",$P{REPORT_LOCALE}, TimeZone.getTimeZone("UTC"))[/code]

    -----------------------------------------

    Step 2: Create the Parameter2, the class is "java.text.DateFormat"

    $P{REPORT_FORMAT_FACTORY}.createDateFormat("MM/dd/yyyy HH:mm",$P{REPORT_LOCALE}, TimeZone.getTimeZone("America/New_York"))[/code]

    -----------------------------------------

    Step 3: Create the variable, the class is "java.util.Date"

    $P{Parameter1}.parse($F{dateStr}.toString())[/code]

    -----------------------------------------

    Step 4: Modified the detail you want to show in table or report

    $P{Parameter2}.format($V{variable})[/code]

    -----------------------------------------

    Then you got the date.

  2. In java code, I use 

     

            String dateStr = "08/14/2018 23:00";        SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");        dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));        Date dateTmp = dateFormat.parse(dateStr);        DateFormat formatterUTC = new SimpleDateFormat("MM/dd/yyyy HH:mm");        formatterUTC.setTimeZone(TimeZone.getTimeZone("America/New_York"));        System.out.println(formatterUTC.format(dateTmp));[/code]

    It is works perfectly to convert a time to EsternTime, but how could I do the same thing on JasperReport? I create some variables for that like "new SimpleDateFormat("MM/dd/yyyy HH:mm").setTimeZone(TimeZone.getTimeZone("UTC"))" but the return type is void which mean I cant use that in expression.

    Anyone know how to deal with that? I appricate it

  3. I'm trying to find a way to add the timestap on report name once I download the report from jasper server. For example, assume there has a report named "ShoppingList" on jasper server. I hope there has a way to add timestamp, so when I download the report, the report name could be like "ShoppingList1520186584". Is there has any way to do that?

    Thanks a lot!

  4. I build a report in eclipse with jaspersoft plugin. Firstly, when I preview it on eclipse, it shows "java heap space". Then I search this problem on the community, and change the memory of -Xms and -Xmx. It works fine. 

    After that, I upload my report to jasper server, and when I run it, the server gives me an error message: “There was an error on the server. Try again or contact site administrators. (Error UID: a0a37c16-5ee7-4c89-915b-791977f09307"

    I tried to search this problem on the internet but nothing found. If anyone knows plz let me know, I'm really appreciate it.

  5. I have two reports and each of them includes a table. There have some columns are common in two tables, so I just copy the table of the first report to the second and then add some new columns to the table of the second report.

    Then I realized that each column has a uuid, so maybe even for different reports, the same columns should have the different uuid.

    Am I right? If so, it means I can't just copy the table to another report, because the uuid will be same. 

×
×
  • Create New...