Jump to content
We've recently updated our Privacy Statement, available here ×

prusyn

Members
  • Posts

    45
  • Joined

  • Last visited

Community Answers

  1. prusyn's post in Pattern Expression was marked as the answer   
    There are a bunch of approaches, which depend on your java knowledge. For example, expressions:
    A)
    String.format("%.2f", new BigDecimal(Double.parseDouble($F{sample})))[/code]B)
    new DecimalFormat("0.00").format(new Double($F{sample}))[/code]where $F{sample} is a field from dataset, that contains numbers. I used sample query: 
    select '25.45060506506456' as sample[/code]Also, attaching report.
  2. prusyn's post in Need help with formatting date fields in an expression was marked as the answer   
    Hi,
    I had to play around a bit, but was able to achieve your desired result. I have created parameter:
    <parameter name="cal" class="java.util.Calendar" isForPrompting="false"> <defaultValueExpression><![CDATA[Calendar.getInstance()]]></defaultValueExpression> </parameter>[/code]and variable:
    <variable name="newDate" class="java.util.Date"><variableExpression> <![CDATA[ ( $P{cal}.set($F{birthdate}.getYear()+1900, $F{birthdate}.getMonth(), $F{birthdate}.getDate()) || $P{cal}.add(Calendar.DATE, 6) ) ? null : $P{cal}.getTime() ]]></variableExpression></variable>[/code]Result looks like that: http://prntscr.com/m8xtdz
    I'll attach sample report with sample data. You should be able to run it without any issues. Let me know if this fits your requirements :)
  3. prusyn's post in Problem with rendering the Dashboard was marked as the answer   
    You are using report rendering function for rendering dashboards - That's the problem. You should be using v.dashboard. For example:
    visualize({ auth: { name: "jasperadmin", password: "jasperadmin", }}, function (v) { var dashboard = v.dashboard({ resource: "/public/Workshop/Profit_Dashboard", container: "#container" });});[/code] 
  4. prusyn's post in HTML5 Chart - Problem displaying data was marked as the answer   
    As I understand the problem is you see two charts, while you should be seeing only one. In this case the problem is that you put the chart in detail band. Everything present in detail band is printed as many times as there are rows in dataset. If you had 100 rows in dataset, you'd end up with 1000 charts :)
    Another issue you might experience would be Caused by: net.sf.jasperreports.engine.JRRuntimeException: Error incrementing bidimensional dataset.
    What I would suggest - place Chart into Summary band.
×
×
  • Create New...