Jump to content
Changes to the Jaspersoft community edition download ×


  • Posts

  • Joined

  • Last visited

victorlizonglin's Achievements

  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 still don't know if it must be unique, but I have given them the new uuid, which is very easy in java code.
  4. OK, I found the answer. The question is transform the escape characters suck as "&" to "&". So the actual question should be how to decode the URL escape characters. The solution is to add a markup element on textField. <textElement markup="html"> The detailed info could be found in there: http://jasperreports.sourceforge.net/sample.reference/markup/
  5. Thank you hozawa, yes I want to unescape the text, I will try to use replace(), thanks
  6. Thank you hozawa, I noticed that the report name will have timestamp if schedule it. And I wonder if there a way to add timestamp when display and export? The timestamp will be the export time.
  7. 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!
  8. Hi guys, I created a report based on my database. Becuase the data in the database has some strange characters, such as "&amp", I wonder if there a way or expression to transform it when previewing the report. Like to add something on Fields expression, so once my report takes the data, the data could be encoded? Thanks for the help!
  9. Check this ref: https://community.oracle.com/thread/4106976?start=0&tstart=0 For import database in jasper, you need create a data adapter first, which connect to your databse. Then create your report with this adapter.
  10. 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.
  11. Read this answer(https://community.jaspersoft.com/questions/523958/custom-chart-box-and-whisker-plot), maybe helpful.
  12. Can anyone let me know - should I change the uuid for each column? I have already written a code to give them uuids. Thanks!
  13. Hi David, I just realized that if I copy the table from one report to another report. Should I change the uuid of each column of the table? There are lots of columns are same in two reports so I just copy one and modified it, but the uuid will be same. Thanks!
  14. 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...