Jump to content
  • Invalid subreportExpression URL should fail-fast


    ge0ffrey
    Assigned User teodord
    CategoryBug report
    PriorityNormal
    ReproducibilityAlways
    ResolutionNo Change Required
    SeverityMajor
    StatusClosed

    When using a subreport with a subreportExpression URL that doesn't exist, the report execution should fail by default, instead of delivering a broken report and letting us believe that everything is all right.

     

    Try this in a report:

    ...

    getClass().getResource("/org/jasperforge/thisFileDoesNotExist.jasper")

    That should fail with an exception, instead of pretending everything is ok.



    User Feedback

    Recommended Comments

    Hi,

     

    The subreport will fail if you would simply use a string expression with only the location of the file in the classpath. JR will look for it and if not found it would tell you.

     

    You unnecessary made use of the Class.getResource(String) method which does not complain about missing resources and simply returns null.

     

    I hope this helps.

    Teodor

    Link to comment
    Share on other sites


×
×
  • Create New...