Jump to content
Changes to the Jaspersoft community edition download ×

Create

Members
  • Posts

    25
  • Joined

  • Last visited

Community Answers

  1. Create's post in Using the value of a parameter as a field name? was marked as the answer   
    Set the paramater MyField as follows:
      Class Type:  java.lang.String
      Default Value Expression:  "`Table1`.`Field_B1`"        <-- Be sure to include the outer double quotes!
                                                                                                    (To mean it's the value of a string, not what creates a string)
    Then write the WHERE as follows:
      WHERE ifnull($P!{FieldName}, FALSE ) = TRUE
     
    Note the use of $P!{..} not $P{..}.
    TIP: It seems you can't insert a parameter between single back quotes, i.e. not this `$P..`, rather you must include the back ticks inside the parameter's value, i.e. "`table_name`.`field_name`".
  2. Create's post in JS Studio: How exactly to return a sub-report total to master-report? was marked as the answer   
    The following assume's all sub-report's totals are named Total, and their accumulated sub-total in their Summary band are named Total1.
    In the parent's report
     
    1) Under Outline right click on Variables and add a new variable named Grand-Total.  This will be where the sub-report's sub-totals will be accumulated (added together).  Set the Initial Value Expression of Grand-Total to 0 (zero).
     
    2) Under Outline, Detail 1, Subreport, Properties, Subreport tab, click the Edit Return Values button, and Add.  Set the following:
    From Variable: To the name of the variable in your sub-report that has the total.  In this case 'Total1'.  (Still not sure how it got named that.) To Variable: To the name of variable in the parent report, in this case Grand-Total. Calculation type: Set this to Sum.  Each time the sub-report runs, this adds Total1 to Grand-Total. 3) Repeat step 2 for each additional sub-report.
    4) In the parent's Summary band create a Text Field and set it's expressioin (value) to $V{Grand-Total}.
  3. Create's post in SQL conditionals w/ MySQL don't work, e.g. if( 1>2, 3, 4), CASE WHEN 1=2 THEN 3 ELSE 4 END, etc. was marked as the answer   
    From hozawa
    "If you're just getting syntax error in Jaspersoft Studio, just ignore it and save it. Most of the time, it's possible to execute even when Jaspersoft Studio shows syntax error if you are 100% sure that the sql statement is correct." - hozawa
  4. Create's post in How to impliment a fluid layout, and what do "Stretch" and "Split" mean in Jaspersoft? was marked as the answer   
    First, use Position Type: Fixed to Top and the control will stay put and not be pushed down if things above it overflow.  Or set it to Float to allow it to be pushed down by things above getting bigger.  Fixed to Bottom is similar to Fixed to Top.
    Next, splitting appears to refer to how data is split, from one page to the next.  It's discussed in The jasperreports-library-ultimate-guide   page 118, in PREVENTING BAND SPLIT.
     
    Finally, from: http://jasperreports.sourceforge.net/schema.reference.html#reportElement
     
    stretchType Specifies the element stretch behavior relative to its element group siblings or element container stretch. Use: optional Base Type: string Values  NoStretch The element won't stretch vertically beyond its natural stretch height, when the container stretches to display other elements.RelativeToTallestObject Deprecated. Replaced by ElementGroupHeight value.RelativeToBandHeight Deprecated. Replaced by ContainerHeight value.ElementGroupBottom The element will stretch to accommodate the overall natural growth of its group, but also taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.ElementGroupHeight The element will stretch to accommodate the overall natural growth of its group, without taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.ContainerBottom The element will stretch to fit the container height, while taking into account its new Y position. This results in the element preserving its distance to the container's bottom edge.ContainerHeight The element will stretch to fit the container height, but without taking into account its new Y position. This might results in the element being shifted up (due to collapsing elements above) or down (due to stretching elements above that push it downards) relative to the container bottom edge. In case the element its already pushed downwards, the additional stretch imposed by the container might actually throw it beyond the container's bottom edge, in which case the element will not render at all. Default: NoStretch 
×
×
  • Create New...