Class ProblemFinder


  • public class ProblemFinder
    extends java.lang.Object
    This is the i-net Clear Reports Problem Finder.
    The Problem Finder is a debug tool. It checks i-net Clear Reports reports for design flaws.
    Use getInstance() to get ProblemFinder instance for checking reports.
    To check an Engine, use the Method check(Engine, int).
    This Method needs the Engine to check and a specific type which defines the kind of checks that will be run.
    For a complete check the type should be CHECK_ALL.
    The ProblemFinder provides two Methods to get the result.
    The getWarningList() returns a list of ProblemFinderWarnings found in the given main Engine.
    The getSubreportWarningMap() returns a Map over all Subreport-Engines with their own list of ProblemFinderWarnings.
    With clearAll() the list and the map will be empty.

    Attention: The ProblemFinderWarning AutoFix-Actions manipulate the Engine, use it carefully or back up your reports if you plan on replacing your report files.

    Example:
     ProblemFinder problemFinder = ProblemFinder.getInstance();
     Engine mainEngine = new Engine( Engine.NO_EXPORT );
     URL source = this.getClass().getResource( "myReport.rpt" );
     mainEngine.setReportFile( source );
     problemFinder.check( mainEngine, ProblemFinder.CHECK_ALL );
    
     List<ProblemFinderWarning> warningListMain = problemFinder.getWarningList();
     for( ProblemFinderWarning warning : warningListMain ) {
         System.out.println(warning.getMessage());
         // ..do something else
     }
    
     HashMap<Engine, List<ProblemFinderWarning>> warningMap = problemFinder.getSubreportWarningMap();
     for( Engine subEngine : warningMap.keySet() ) {
         List<ProblemFinderWarning> warningListSub = warningMap.get( subEngine );
         for( ProblemFinderWarning warning : warningListSub ) {
             System.out.println(warning.getMessage());
             // ..do something else
         }
     }
     
    Since:
    11.0
    See Also:
    ProblemFinderWarning