Package com.haulmont.yarg.loaders.impl

Examples of com.haulmont.yarg.loaders.impl.GroovyDataLoader


        reporting.setFormatterFactory(formatterFactory);
        reporting.setLoaderFactory(
                new DefaultLoaderFactory()
                        .setSqlDataLoader(new PropertiesSqlLoaderFactory(propertiesLoader).create())
                        .setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl()))
                        .setJsonDataLoader(new JsonDataLoader()));
        return reporting;
    }
View Full Code Here


        Report report2 = new DefaultXmlReader().parseXml(xml);
        System.out.println();

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(new DefaultLoaderFactory().setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl())));
        reporting.runReport(new RunParams(report1));
        reporting.runReport(new RunParams(report2));
    }
View Full Code Here

        System.out.println();

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(new DefaultLoaderFactory()
                .setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl()))
                .setSqlDataLoader(new SqlDataLoader(testDatabase.getDs())));

        ReportOutputDocument reportOutputDocument = reporting.runReport(new RunParams(report), new FileOutputStream("./result/sample/bookstore.xls"));

        testDatabase.stop();
View Full Code Here

    private Map<String, Object> emptyMap;

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

        DataExtractorImpl dataExtractor = new DataExtractorImpl(loaderFactory) {
            {
                emptyMap = EMPTY_MAP;
            }
View Full Code Here

        Report report = new DefaultXmlReader().parseXml(FileUtils.readFileToString(new File("./modules/core/test/sample/invoice/invoice.xml")));
        System.out.println();

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(new DefaultLoaderFactory().setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl())));

        ReportOutputDocument reportOutputDocument = reporting.runReport(new RunParams(report), new FileOutputStream("./result/sample/invoice.pdf"));
    }
View Full Code Here

        Report report = reportBuilder.build();

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(
                new DefaultLoaderFactory().setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl())));

        ReportOutputDocument reportOutputDocument = reporting.runReport(
                new RunParams(report), new FileOutputStream("./result/sample/invoice.docx"));
    }
View Full Code Here

        }
    }

    @Test
    public void testGroovyLoader() throws Exception {
        GroovyDataLoader groovyDataLoader = new GroovyDataLoader(new DefaultScriptingImpl());
        BandData rootBand = new BandData("band1", null, BandOrientation.HORIZONTAL);
        rootBand.setData(Collections.<String, Object>emptyMap());

        List<Map<String, Object>> result = groovyDataLoader.loadData(
                new ReportQueryImpl("", "return [['a':123, 'b':321], ['a':456, 'b':654]]", "groovy", null, null)
                , rootBand, Collections.<String, Object>emptyMap());
        printResult(result);
    }
View Full Code Here

        BandData rootBand = new BandData(BandData.ROOT_BAND_NAME);
        rootBand.setData(new HashMap<String, Object>());
        rootBand.setReportFieldFormats(report.getReportFieldFormats());
        rootBand.setFirstLevelBandDefinitionNames(new HashSet<String>());

        new DataExtractorImpl(new DefaultLoaderFactory().setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl()))).extractData(report, new HashMap<String, Object>(), rootBand);

        List<BandData> bands = rootBand.getChildrenByName("Band1");
        for (BandData band : bands) {
            if (((Integer)1).equals(band.getParameterValue("link"))) {
                Assert.assertEquals(1, band.getParameterValue("col1"));
View Full Code Here

        System.out.println();

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(new DefaultLoaderFactory()
                .setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl()))
                .setSqlDataLoader(new SqlDataLoader(testDatabase.getDs())));

        ReportOutputDocument reportOutputDocument = reporting.runReport(new RunParams(report), new FileOutputStream("./result/sample/breakdown.xls"));

        testDatabase.stop();
View Full Code Here

        Reporting reporting = new Reporting();
        reporting.setFormatterFactory(new DefaultFormatterFactory());
        reporting.setLoaderFactory(
                new DefaultLoaderFactory()
                        .setGroovyDataLoader(new GroovyDataLoader(new DefaultScriptingImpl())));

        ReportOutputDocument reportOutputDocument = reporting.runReport(
                new RunParams(report), new FileOutputStream("./result/sample/incomes.xlsx"));
    }
View Full Code Here

TOP

Related Classes of com.haulmont.yarg.loaders.impl.GroovyDataLoader

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.