Jump to content
  • Incorrect band height in PDFs when isStretchWithOverflow=true is used


    olegk
    Assigned User teodord
    CategoryBug report
    PriorityUrgent
    ReproducibilityAlways
    ResolutionFixed
    SeverityCritical
    StatusClosed

    The total band height appears to be miscalculated when some of the elements has isStretchWithOverflow attribute set to true and export format is PDF. The problem is reproducible with the latest official release 2.0.3 using the following code snippet and the report template (inlined)

    ====

    ClassLoader cl = Test.class.getClassLoader();

     

    InputStream instream = cl.getResourceAsStream("jaspertest/template.jrxml");

    JasperReport template = JasperCompileManager.compileReport(instream);

     

    Map parameters = new HashMap();

     

    JasperPrint print = JasperFillManager.fillReport(template, parameters,

    new JRBeanArrayDataSource(new Object[] {"stuff"}));

    FileOutputStream outstream = new FileOutputStream("tmp.pdf");

    try {

    JasperExportManager.exportReportToPdfStream(print, outstream);

    } finally {

    outstream.close();

    }

    ====

    <?xml version="1.0"?>

    /p>

    PUBLIC "-//JasperReports//DTD Report Design//EN"

    "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

     

    pageHeight="842" pageWidth="595" columnWidth="495" columnCount="1"

    topMargin="30" bottomMargin="30" leftMargin="50" rightMargin="50">

     

    boolean.TRUE

    "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"

     

    boolean.TRUE

    "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"

     

    boolean.TRUE

    "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"

     

    ====

     

    Please let me know if you need any additional input


    Attachments: tmp.pdf

    User Feedback

    Recommended Comments

    I am laso attaching the resultant PDF document. As one can see there is an extra line space between the group one and the group two, which is not supposed to be there.
    Link to comment
    Share on other sites

    Hi Teodor

     

    I really appreciate your getting back to me.

     

    I am developing on Ubuntu 7.10 and deploying on Fedora 5. I have not actually checked whether the problem is reproducible on non-Linux platforms. It does seem to be fond matching related.

     

    Oleg

     

     

    Link to comment
    Share on other sites

     

    Hi,

     

    If you create your reports on one system and deploy them on another, then you must specify fonts and even deploy fonts with your application. In your report template you say nothing about fonts and this means you are relying on the default font settings of JasperReports.

    That\'s fine, but with these default font settings (which are generic logical fonts of the JVM) might point to different font file on different systems, with different metrics. This is why you experience this problem.

     

    I\'m closing this, as it is not a bug. If you have more questions about how to solve this, please use the forums. A good start would be to look at our /demo/samples/fonts sample provided with the project.

     

    Thank you,

    Teodor

     

    Link to comment
    Share on other sites


×
×
  • Create New...