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. 1. Not "=="! Use $V{NOT_PROCESSED}.equals(new java.lang.Integer(0)) ? new java.math.BigDecimal(0) : new java.math.BigDecimal(1)

    If "==" this expression always false.

     

    2. May be this expression is never computing? Try to clear initialValueExpression. Are you get not null $V{NOT_PROCESSED} value in this case?

  2. It is strange behavour. But probably I was too short in the explanations.

     

    I writing in iReport by using java-collections. In this case i do next steps:

    1. Define java-class for the storage of result my calculations. For example:

    class FirstColumnInfo

    private String FirstColumnValue;

    private List<FirstColumnChildren>

    ...

    class FirstColumnChildren

    private String SecondColumn;

    private String ThirdColumn;

    and so on

     

    2. Writing java-code for search data. In this code i fill my structure:

    Collections<FirstColumnInfo> resultComputing = findCollection();

     

    3. Creating DataSource and filling JasperReport:

    JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(resultComputing);

     

    4. Filling Report:

    JasperFillManager.fillReport("report.jasper", reportParametrs, dataSource)

     

    ... and so on (some actions for subreport)

     

    If you are use SQL-query as data source for report, i think that you must to do two query (1. for main report and 2. for subreport):

    1. select distinct(first column) from (yuor query)

    2. For subreport you must define parameter: firstColumn

    and query for subreport (select * from (your query) where first_column=Parameter)

     

    It is very bad by productivity, but i think you may find optimal queries for both reports (main and subreport).

     

    Good luck

     

  3. I make subreport with all fields (excluding first field). First field and subreport placed into frame with displayed borders. First field haven't borders.

    In result of execution report, first field displayed with borders of the frame (borders not in every row for first field).

     

    Sorry for bad english

  4. Hi!

     

    Method "add" is the method of java.util.Calendar, but not java.util.Date

     

    You need:

    1. Write java-class to work with dates (or find in internet, it's named approximately "DateUtils").

    Example method of whis class:

    public static Date addField(Date date, int field, int count) {

    Calendar calendar = Calendar.getInstance();

    calendar.setTime(date);

    calendar.add(field, count);

    return calendar.getTime();

    }

     

     

    2. Define classPath in iReport(Tools/Options/Classpath) with path to DateUtils.class

     

    3. in iReport define Initial Value Expression for Variable:

    ru.rtec.sgsr.util.report.DateUtils.addField($F{mydatefield}, Calendar.MONTH, 2)

     

    With best regards

  5. It's very strange error. Are you sure that this error occurs at report performance?

    By a subreport calling (*.jasper) compilation don't must to do. In this case calling method loadObject().

    The stack error in this case looks approximately so:
    Caused by: net.sf.jasperreports.engine.JRException: Could not load object from location: ... main\Project\Reports\reports\r1140_points.jasper 
    (it's my stack trace)

    It's error is not error of compilation!

    I don't see the full stack trace of yours error, therefore it's very hard to give correct advice.

    But I have one assumption:
    I Has received the similar stack trace on COMPILATION of my main report (jasper v 4.02):
    Unable to locate the subreport with expression: "$P{SUBREPORT_DIR}.concat($F{time})".
    java.lang.Exception     
    at com.jaspersoft.ireport.designer.utils.Misc.locateFileFromExpression(Misc.java:1396)     
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.compileSubreports(IReportCompiler.java:1418)
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:509)     
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

    This error has occurred by the compilation of my main report from iReport Designer. In my iReport at "Tools/Options/Compilation and execution" tabs chekbox "Compile subreports (if can be found)" sets on. Uncheck this.

    Sorry for bad english



  6. Hi.
    If you are haven't problems with displaing this maps ( for example  toString(key_of_Map) ), then you may to use the next advice.

    Display list by using subreport. For subreport you must write java-class implementing JRDataSource interface (methods next() and getFieldValue() )  and initialization data (the same List<String>) for this methods

    Sorry fo bad english

  7. For removing images you must set FALSE to exporter parameters IS_USING_IMAGES_TO_ALIGN

    cut the code:
    --- start cut
    JRExporter exporter = null;
    ...
    if (reportFormat.equals(ReportFormat.HTML)) {
      exporter = new JRHtmlExporter();
      ...
      exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);
    }
    ...
    exporter.exportReport();
    -- end cut

    Sorry for bad english :)
     

×
×
  • Create New...