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

sanbez

Members
  • Posts

    296
  • 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

Posts posted by sanbez

  1. You can use subreport

    In main report define field corresponding getter for nested bean collection.
    For example

    public class MyBean() {

    private List<MyNestedBean> mysuperpuperNestedBeans;

    private Long id;

    public Long getId() {

    return id;

    }

    public List<MyNestedBean> getNestedBeans() {
         return mysuperpuperNestedBeans;
    }

    }

     

     

    public class MyNestedBean() {

    private String firstStringField;

    public String getFirstStringField() {

    return firstStringField;

    }

    }


    in jrxml define fields
    $F{id} with type Long
    $F{nestedBeans} with type java.util.Collectioin  (name of field corresponds getter getNestedBeans)

    make subreport in detail band of main report
    Define in main jrxml DataSourceExpression for subreport like this

    new JRBeanCollectionDataSource($F{nestedBeans})

    define fields in subreport corresponding getters in MyNestedBean class

    for example $F{firstStringField} with type java.lang.String

     

    HTH

  2. >>If I set the 'print when' value of the detail band to false, the subreport in the detail band is not started
    Yes, jasper will not execute subreport in this case.

    Strange desire to put subreport into detail band if subreport is not depend on data of detail band.
    For example if your report contain 2 records in detail band then subreport will executed twice.
    I can't understand idea (aim) to execute subreport in detail band

    You can put subreport into summary band.
     

  3. Question was:
    >>where I shouls put my parameters? in master or subreport ?

    In example
    http://community.jaspersoft.com/wiki/subreports

    field $F{ID} passed from main report to parameter $P{ID_PERSON} of subreport

    You can pass param into main report.  Fro example $P{myParam1} from your application
    After that you can pass $P{myParam1} from main report to subreport

    There are no fundamental deffirences between pass field or parameter of main report to subreport.
    I can't understand your problem (or doubt?). You got enouph information to solve your problem.
    Just do it.

    Good luck

     

  4. Good example to show columnPrintWhenExpression

    but
    !$P{EMPLOYEEID}.equals(null)    -  it is nonsense (imho)

    It always true when $P{EMPLOYEEID} != null
    It cause NPE when $P{EMPLOYEEID} == null

    To topicstarter:
    Discussion without your code (description of condition on column) is not efficient.
    Show jrxml and describe condition which you want 

  5. You can realize incrementer on java which return null (or your own specific object in terms of java) instead zero

    http://www.jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/fill/JRExtendedIncrementer.html
    http://www.jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/fill/JRExtendedIncrementerFactory.html

    But...
    There are few information about realization of such classes in internet and documentation
    And this way not for newbies imho

    I guess you have choose the easier way. For example you can calculate count not null values on column (row?) of crosstab and hide sum variable if this count = 0
    see here http://www.stackoverflow.com/questions/23473887/count-number-of-rows-where-a-field-is-a-specific-value/23491357

     

×
×
  • Create New...