Package com.haulmont.yarg.reporting

Examples of com.haulmont.yarg.reporting.DataExtractorImpl


    @Test
    public void testSelectingEmptyBands() throws Exception {
        DefaultLoaderFactory loaderFactory = new DefaultLoaderFactory();
        loaderFactory.setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl()));

        DataExtractorImpl dataExtractor = new DataExtractorImpl(loaderFactory) {
            {
                emptyMap = EMPTY_MAP;
            }
        };
        dataExtractor.setPutEmptyRowIfNoDataSelected(true);
        Report report = createReport();
        BandData rootBand = rootBand();

        dataExtractor.extractData(report, new HashMap<String, Object>(), rootBand);
        System.out.println(rootBand);
        Assert.assertEquals(1, rootBand.getChildrenList().size());

        BandData band1 = rootBand.getChildrenList().get(0);
        Assert.assertEquals(emptyMap, band1.getData());

        Assert.assertEquals(1, band1.getChildrenList().size());
        Assert.assertEquals(emptyMap, band1.getChildrenList().get(0).getData());


        dataExtractor.setPutEmptyRowIfNoDataSelected(false);
        rootBand = rootBand();
        dataExtractor.extractData(report, new HashMap<String, Object>(), rootBand);
        System.out.println(rootBand);

        Assert.assertEquals(0, rootBand.getChildrenList().size());
    }
View Full Code Here

TOP

Related Classes of com.haulmont.yarg.reporting.DataExtractorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.