Menu

#1 DJ ignores property stored in a template jrxml.

closed
7
2009-07-07
2008-07-16
Anonymous
No

Hi!

I'm using DJ 2.0.8 really succesful. Currently I use a JRXML Template and use DJ to create the report based upon a JTable (data, column order, column visiblity, column size and so on). My Template contains properties that tell jasper to create a useable Excelsheet. Simply spoken it's the data packed into a XLS with only minimal graphical stuff.

<p>
FastReportBuilder drb = new FastReportBuilder();</br>
drb.setTemplate("XXX.jrxml");</br>
JRDataSource ds = new JRTableModelDataSource(model);</br>
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(drb.build(), new ClassicLayoutManager(), ds);</br>
jp.hasProperties() --> Returns always false...
</p>

So DJ simply loses the properties somewhere.
I can define the properties simply in runtime with <b> jp.setProperty("net.sf.jasperreports.export.xls.remove.empty.space.between.rows", "true");</b> for example.

Dennis Guse
http://dennis.g00se.org
g00se {at} web [dot] de

Discussion

  • Juan Manuel Alvarez

    • priority: 5 --> 7
    • assigned_to: nobody --> djmamana
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
  • Juan Manuel Alvarez

    • labels: --> general (API)
    • milestone: --> Next_Release_(example)
     
  • Juan Manuel Alvarez

    Logged In: YES
    user_id=1517571
    Originator: NO

    Hi Dennis, I was looking to the feature request you proposed, and Im finding some trouble (maybe becuase its to late here :)

    I added report custom properties to DynamicJasper (programatically and from jrxml), when compiled, the JasperReport object gets the properties, but after fill, the JasperPrint does not have them anymore...

    FastReportBuilder drb = new FastReportBuilder();
    drb.setTemplate("XXX.jrxml");
    JRDataSource ds = new JRTableModelDataSource(model);
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(drb.build(), new
    ClassicLayoutManager(), ds);
    jp.hasProperties() --> Returns always false...

    jp.hasProperties() is from JasperReport version 3.0.0 which has not been fully tested, but lookint at the code, it just checks for the propertiesMap to not be empty.
    Anyway after creating the jasperReport, the only remaining step is calling the JasperFillManager class, but no more DynamicJasper magic, Im not sure how is supposed that JasperReport passes the properties from the jasperReport to the JasperPrint. Im not even sure if such properties should not be passed manually.

    Do you usually use such functionality of custom properties in plain jasperReprot (no DynamicJasper at all)? can you give an example of how you compile and fill the report while getting properties copied from jrxml to the jasperPrint object?

    thank you very much
    bye bye
    Dj

     
  • Juan Manuel Alvarez

    • status: closed --> open
     
  • Juan Manuel Alvarez

    This issue is related to JasperReport API, DJ is just a passthrough

     
  • Juan Manuel Alvarez

    • status: open --> closed
     

Log in to post a comment.