Jump to content
  • Substring disabling full-string to print on nextline


    atulnamdeo7
    Assigned User teodord
    CategoryBug report
    PriorityHigh
    ReproducibilityAlways
    ResolutionFixed
    SeverityCritical
    StatusResolved
    Versionv6.0.0

    We have 2 string of same size, one string is getting printed completely and other one is getting split(last word of string is not printing).

     

    working : CNIP OFFSETAUG23TEST01 - JA8NM1811QVX1AGI - XXXXXXX.XXX XXXXXXXXX X-XXXXXXXX - PAYMNT1PAYMNT2PAY

     

    not working : CNIP OFFSETAUG22TEST02 - JA8ME5718GIV1AXF - XXXXXXX.XXX XXXXXXXXX X-XXXXXXXX - PAYMNT1PAYMNT2PAY

     

    We have tested PDF with few scenarios it seems like jasper is not handling "isStretchWithOverflow" attribute properly when string "- JA8ME5718GIV1AXF -" includes V with string size more then 92.

     

    eg-: "- JA8NMIV11811QVX1 -", "- JA8NMV11811QVX1 - "," - JA8NMV21811QVX1 -"

     

    string is not working with mentioned eg substrings.

     

    snippet of jrxml is below-:

     

    $F{AVALTY}!=null

    $F{AVALTY}



    User Feedback

    Recommended Comments

    Changed Status from New to Feedback Requested

    Changed Assigned User from - to @teodord


    Hi,The problem comes from the fact that you are not specifying any font for your text fields. So a default font is used, both when the text size is calculated at report fill time and then when the text is actually rendered in PDF.The problem is that AWT and PDF have different fonts as defaults, with different metrics. So while the text might fit when filling the report (AWT calculations), it does not fit in PDF, where the default font is slightly larger.The solution is to make sure the exact same font is used by Java/AWT at report fill time and then embedded into the PDF at export time.This can be done with font extensions, which can be created with Jaspersoft Studio.The easiest to fix this is to use one of the DejaVu fonts that we ship with the jasperreports-fonts-x.x.x.jar and which is available in all Jaspersoft products, including JSS and JRS.If you embed the library in your own Java application, just make sure this JAR is added to the classpath.I hope this helps.Teodor
    Link to comment
    Share on other sites


×
×
  • Create New...