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

jaapandre

Members
  • Posts

    12
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by jaapandre

  1. It sound like you posted the SRP, but I cannot find it. Or did I miss something?
  2. I have a subreport with a crosstab. Each row shows the average on a topic. I want to color the background of the cells based on the average of al scores (low average: red, high average: green, in between: yellow) The range of the scores can vary (so on one topic 3 is good, on another it is bad) At this moment I have a subreport parameter containing a json string to determin the range of the score per topic (eg: (topic1:scale5, topic2: scale6, topic3: scale3)) I have another subreport parameter which contains a hashmap with per range of the scores (eg scale5) the bottom-value, the top-value and each color How can I get the range of a specific topic? I tried a scriplet, but they don't work in a crosstab I tried to use: org.json.simple.JSONValue.parse($P{SCALE_QUESTION_INFO}").get($F{topic}), but that gives a error the method get{String) is undefined for the type Object Any help would be appreciated.
  3. I want to create a stacked bar chart with 3 categories (negative, neutral, positive), but I have for instance scores from 1-10 or 1-5, so I need to combine/recode the value to get the right series expression (and use it for group expression). If i compute this value in the report itself (1): <variable name="valueRecoded" class="java.lang.String" resetType="Group" resetGroup="value"> <variableExpression><![CDATA[($F{val}.equals("1") || $F{val}.equals("2") ? "2" : ($F{val}.equals("4") || $F{val}.equals("5") ? "4": $F{val}) )]]></variableExpression> The barchart is created as it should (using a barchartCustomizer for percentages, colors etc). However I want to use a scriptlet to be more flexible (see attachment 2). It contains some exotic code, but at the end it sets the variable "valueRecoded". However if I generate the report (jrxml in attachment 3), the count value is not reset anymore. Which results in the barchart according to attachment 1, the unrecoded values: 6,3,9, which should be recoded to 2,1,3 resulting in bars of equal sizes (and 33,3% as label). The full code is also available via https://github.com/Nivocer/webenq/tree/5671-barchart/java/src I'm using jasper report 4.5 (it also doesn't work on 4.1). I tried several options to reset the value and several options when to calculate the valueRecoded (afterReportInit, etc). I hope somebody can help Jaap-Andre (1) I guess the resetType=group resetGroup=value is not needed here
  4. I need to round the outcome of a sum using round_half_up, in stead of the (default) round_half_even. I also need to set the number of decimals dynamically, preferably via a styleTemplate. Is this possible? I found the solution to adjust the expression in the textfield, (unfortunately I did not get it working yet), but I guess it is not possible to set the number of decimals using a styletemplates. It this correct, or am I wrong? If it is possible to set the default method of numberformat to round_half_even, it is even better. I wonder if the pattern expression (in stead of pattern) could be usefull, but I cannot found documentation about it. Best regards, Jaap-Andre Post Edited by jaapandre at 16/12/2011 12:56
  5. Aha, seems like it gets broken just at the end of the 'box', just the same with the pdf. Guess the excel could be the best solution for now. Groet, Jaap-Andre
  6. Hi Sanda, Thanks again. I guess the html.wrap.break.word-property is used to enter newlines between words, not for breaking within words, but I'll check it to be sure. The tracker already contains an issue (#2672) for hyphenation since 2006. I recently added my thoughts in the hope it gets attention. Best regards, Jaap-Andre
  7. Hi Sanda, Thanks for your reaction. I already used/tried 1) and 2). But Excel could be (for now) a workaround. I hoped it was also possible for pdf. Itext (which I believe is used to generate the pdf) does support hyphenation, but it is/I am not (yet?) able to use is? Best regards, Jaap-Andre
  8. I have a problem with the hyphenation. As far as I understand jasper reports doesn't support hyphenation[*], but hopefully I'm wrong.... my report contains a crosstab with (of course) fixed width of column. The column header text (eg) contains sometimes one word which needs more space than the column width. At this moment this is broken into for instance accountanc <newline> y, which is of course not correct/ugly. Is there a possibility to improve this? Jaap-Andre, quite desperate [*] see http://jasperforge.org/projects/jasperreports/tracker/view.php?id=2672
  9. Ah well. I tried to use a measure in the crosstabRowHeader, but that seems not possible... But I'm able to use it in a crosstabcell. Fortunately that's the place that I use it.
  10. Thanks for your reaction. Below you find some parts of the jrxml, which (I think) are relevant. <field name="row_id" class="java.lang.String"/> <field name="row_text" class="java.lang.String"/> <field name="col" class="java.lang.String"/> <field name="title_row" class="java.lang.String"/> <field name="title_col" class="java.lang.String"/> <field name="val" class="java.lang.String"/> <measure name="row_text" class="java.lang.String" calculation="First"> <measureExpression><![CDATA[$F{row_text}]]></measureExpression> </measure> <rowGroup name="row" width="258" totalPosition="End"> <bucket> <bucketExpression class="java.lang.String"><![CDATA[$F{row_id}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Opaque"> <box leftPadding="0"> </box> <textField isStretchWithOverflow="true"> <reportElement style="Crosstab Data Text" x="0" y="0" width="258" height="15"/> <box> </box> <textFieldExpression class="java.lang.String"><![CDATA[$V{row}+": "+$V{row_text}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents mode="Opaque"> <box rightPadding="0"> </box> </cellContents> </crosstabTotalRowHeader> </rowGroup>
  11. I'm a newbie concerning jasper reports and java :-( But JasperReports (and java) sounds promissing so I'm trying to generate a report using ireport (3.7.2) with crosstabs. In the database I have row_id and row_text. In the crosstab I want to use both these fields I use $F{row_id} for the bucket expression for the 'row groups' which creates $V{row_id} and I think I need to use 'Measures' to be able to use the row_text. Unfortunately I didn't succeed to create this measure. I tried: name: row_text measure class: java.lang.string value expression: $F{row_text} Calculation: first But if I use this variable in the report it returns 'null'. I hope somebody could help. Jaap-Andre, there doesn't exist stupid questions, only stupid questioners
×
×
  • Create New...