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

szaharia

Jaspersoft Staff
  • Posts

    16
  • 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 szaharia

  1. 1) set the net.sf.jasperreports.export.xls.pattern property for that element with the value "d-MMM-yyyy h:mm AM/PM" 2) Not sure what is the issue here. 5.75 really means 575% in percents. If you need to display something like 6% instead of 5.75, you could place $F{myDatabaseField}/100.0 in your textfield instead of $F{myDatabaseField}, and use the "#,##0%" pattern
  2. Make sure the 'Remove Line When Blank' is checked for elements in rows that have 'Print When Expression' set to false. Additionally, set 'Position Type' as 'Float'.
  3. If your variable is of type java.lang.String, use !$V{affiche}.equals("0") as print when expression. If your variable is of type java.lang.Integer, use $V{affiche} != 0
  4. There is no more need of the 'Markup' attribute. Your texfield should look like below, in the JRXML file: <textField pattern="#0.000;(#0.000-)"> <reportElement x="430" y="2" width="30" height="20" uuid="4eba3e3c-c0d5-4da0-a71a-b805092110a9"> <property name="com.jaspersoft.studio.unit.height" value="pixel"/> <property name="com.jaspersoft.studio.unit.width" value="pixel"/> <propertyExpression name="net.sf.jasperreports.style.forecolor"><![CDATA[$F{previous4} < 120 ? "red" : "black"]]></propertyExpression> </reportElement> <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{previous4}]]></textFieldExpression></textField>[/code]
  5. You could set the 'Ignore Pagination' flag to true. In addition, you could use the net.sf.jasperreports.export.csv.exclude.origin.band.{arbitrary_name} property in a similar way as described here: http://community.jaspersoft.com/wiki/how-can-i-suppress-page-headers-and-footers-when-exporting-xls
  6. Below is an example of using net.sf.jasperreports.style.forecolor property expression: <propertyExpression name="net.sf.jasperreports.style.forecolor"><![CDATA[$F{previous4} < 120 ? "red" : "black"]]></propertyExpression>[/code]
  7. Instead of html markup, you could use a conditional style or the net.sf.jasperreports.style.forecolor property expression for that element.
  8. You could place an empty frame in the report that: has the same x, y, width and height as the textfield.is 'Opaque' and has a blue backcolorhas 'Print repeated values' set to trueis placed under the textfield (in the JRXML file the frame is defined before the textfield):<frame> ...</frame><textField> ...</textField>[/code]
  9. Since JR 6.3.1 you could use the net.sf.jasperreports.sql.field.column.name property for each field, to map the column name dinamically. Meaning you could use a static field name in JRXML that will map a column name in your dynamic query. For instance: <parameter name="paramId" class="java.lang.String"> <defaultValueExpression><![CDATA["emp_id"]]></defaultValueExpression> </parameter>... <field name="id" class="java.lang.Integer"> <propertyExpression name="net.sf.jasperreports.sql.field.column.name"><![CDATA[$P{paramId}]]></propertyExpression> </field>[/code]In the above example, whenever you will use the $F{id} expression in the JRXML file, the "emp_id" column in the sql query will be referenced, via the parameter paramId.
  10. You could let the page height unchanged, place each chart on a different page, and set the Ignore Pagination report flag to true. This will generate a single page document at runtime. But you also have to take into account that some document viewers cannot display pages of 450 cm height.
  11. You could use 2 texfields with the same position within the report: one of them having the Stretch with Overflow attribute set to true, the other having the same attribute set to false. For each textfield use a print when expression that depends on your boolean parameter.
  12. You need to write a print when expression for each textfield and use the static value of the X-coordinate in each expression. For instance, if the textfield has X = 20, the related print when expression should look like: $F{START_POSITION} <= 20 && $F{END_POSITION} >= 20[/code]
  13. There was a change regarding this method signature in poi-3.15. The upcoming JR release will reflect also this change and will be compatible with poi-3.15.
  14. Could you post a JRXML sample that illustrates the problem? Thank you.
  15. Thank you for this detailed explanation. :) To get the same dynamic color for the element background as in highlighted text, just set the property for the textfield: <propertyExpression name="net.sf.jasperreports.style.backcolor"><![CDATA[$F{strColorHex}]]></propertyExpression> Make sure the element's mode is set as 'Opaque'. Also make sure the element gets always printed (there is no print when expression set for this element) These above settings should solve the problem.
  16. Hi, please let me know if I properly understood the case: - if $F{strShownText} is null or empty, the element background should be visible, colored as $F{strColorHex} - if $F{strShownText} is not empty (let's say if $F{strShownText} = "Test"), the background should not be displayed, in order to make the text visible If it's correct, then you could set the following properties for the element: <propertyExpression name="net.sf.jasperreports.style.backcolor"><![CDATA[$F{strColorHex}]]></propertyExpression> <propertyExpression name="net.sf.jasperreports.style.mode"><![CDATA[$F{strShownText} == null || $F{strShownText}.equals("") ? "Opaque" : "Transparent"]]></propertyExpression> In case you need the background to be always displayed, then set only the net.sf.jasperreports.style.backcolor property as shown above, and make sure the texfield mode is always Opaque.
  17. In case you need the element's background to be filled only when a condition is met, you could use either a conditional style, or the following dynamic style properties at element level: net.sf.jasperreports.style.backcolornet.sf.jasperreports.style.modeMore on dynamic style properties you can find out here: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.style.{style_property_suffix}
  18. You need to arrange the data into groups that break after every 8 records (see some examples of data grouping here). Then, create a detail band containing the textfield with data. Create a second detail band containing a line element. For this second detail band use a print when expression in the form: $V{myGroup_COUNT} == 2 || $V{myGroup_COUNT} == 3 || $V{myGroup_COUNT} == 5 || $V{myGroup_COUNT} == 8[/code]where 'myGroup' is the group name.
  19. Try ($P{p_trip_entry_begin} != null ? $P{p_trip_entry_begin} + ($P{p_trip_entry_end} != null ? " AND ":"") : "") + ($P{p_trip_entry_end} != null ? $P{p_trip_entry_end}.toString() : "")[/code]
  20. It may be a problem with the "dd/mm/yyyy" pattern, since 'mm' usually stands for minutes. Try to use "dd/MM/yyyy" instead.
  21. $V{TOTTR3}/$V{TOTFIN3} is evaluated in expression because it is a function parameter. Try this expression instead: $V{TOTFIN3}==0 ? 0 : $V{TOTTR3}/$V{TOTFIN3}
  22. In case of repeating page header, set this property in the report: <property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value=""/>[/code]To repeat column header, you should set this property: <property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.3" value=""/>[/code]
  23. Here you can find some useful information: http://community.jaspersoft.com/wiki/why-first-record-missing-my-subreport
  24. You could use a break element placed above the type textfield with a print when expression: <break> <reportElement x="0" y="0" width="100" height="1"> <printWhenExpression><![CDATA[$V{REPORT_COUNT} > 1 && $F{type}.equals("A")]]></printWhenExpression> </reportElement></break>[/code]
×
×
  • Create New...