Package org.orcateam.report.engine.docx

Examples of org.orcateam.report.engine.docx.DocXReport


    @Test
    public void test() throws Exception {

        InputStream inputStream = getClass().getResourceAsStream("/IterationListFromRowObject.docx");
        OrcaReport orcaReport = new DocXReport(inputStream);

        // table:source
        List<People> peopleList = generatePeopleList(6, 40);

        orcaReport.put(OrcaReportParam.NULL_STRING, "...");

        // we generate the form which will include the people list.
        // views are often used to reduce the input count that should be passed to the orca report
        // and also a good way to organize form values.
        FormView view = new FormView();
        view.setPeeps(peopleList);

        orcaReport.put("view", view);

        byte[] output = orcaReport.render();
        writeTestResults(output);

    }
View Full Code Here


public class ParagraphRenderedTest extends BaseOrcaTest {
    @Test
    public void test() throws Exception {
        InputStream inputStream = getClass().getResourceAsStream("/ParagraphRendered.docx");
        OrcaReport orcaReport = new DocXReport(inputStream);

        orcaReport.put(OrcaReportParam.NULL_STRING, "...");
        orcaReport.put("nullExpression", null);
        orcaReport.put("notNullExpression", "not null");
        orcaReport.put("renderedCell", null);

        // table:source
        List<People> peopleList = new ArrayList<People>();
        for (int i = 1; i < new Random().nextInt(3) + 3; i++) {
            People people = new People("Person " + i, new Random().nextInt(5) + 20);
            people.getPuans().put(2013, new Random().nextInt(100));
            people.getPuans().put(2014, new Random().nextInt(100));
            people.getPuans().put(2015, new Random().nextInt(100));
            people.getPuans().put(2016, new Random().nextInt(100));
            people.getPuans().put(2017, new Random().nextInt(100));
            // Lets skip this year
            // people.getPuans().put(2018, new Random().nextInt(100));
            people.getPuans().put(2019, new Random().nextInt(100));
            people.getPuans().put(2020, new Random().nextInt(100));

            peopleList.add(people);
        }

        //column:source
        List<Integer> yearList = new ArrayList<Integer>();
        yearList.add(2013);
        yearList.add(2014);
        yearList.add(2015);
        yearList.add(2016);
        yearList.add(2017);
        yearList.add(2018);
        yearList.add(2019);
        yearList.add(2020);

        orcaReport.put(OrcaReportParam.NULL_STRING, "...");
        orcaReport.put("peopleList", peopleList);
        orcaReport.put("yearList", yearList);

        byte[] output = orcaReport.render();
        writeTestResults(output);
    }
View Full Code Here

    @Test
    public void test() throws Exception {

        InputStream inputStream = getClass().getResourceAsStream("/TableWithMergedCells.docx");
        OrcaReport orcaReport = new DocXReport(inputStream);

        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy EEEE");
        SimpleDateFormat hourFormat = new SimpleDateFormat("HH:mm");

        orcaReport.put(OrcaReportParam.NULL_STRING, "");
        orcaReport.put("formId", new Random().nextInt(350));
        orcaReport.put("companyName", "Big Dollars Incoming Corp.");
        orcaReport.put("departmentName", "Most Feared Department");
        orcaReport.put("formName", "Firing Employee Form");
        orcaReport.put("formDate", dateFormat.format(new Date()));
        orcaReport.put("formHour", hourFormat.format(new Date()));
        orcaReport.put("toWhom", "the President of the Orca Republic");
        orcaReport.put("ownerName", "Murat SAYILGAN");
        orcaReport.put("location", "unknown");
        orcaReport.put("things", getTheThings());
        Employee employee = new Employee("Senior Developer", "Kamil ÖRS");
        orcaReport.put("employee", employee);

        byte[] output = orcaReport.render();
        writeTestResults(output);

    }
View Full Code Here

    @Test
    public void test() throws Exception {

        InputStream inputStream = getClass().getResourceAsStream("/TableInsideTableForm.docx");
        OrcaReport orcaReport = new DocXReport(inputStream);

        // table:source
        List<People> peopleList = generatePeopleList(4, 20);
        List<People> differentPeopleList = generatePeopleList(2, 50);


        //column:source
        List<Integer> yearList = new ArrayList<Integer>();
        yearList.add(2014);
        yearList.add(2015);
        yearList.add(2016);
        yearList.add(2017);
        yearList.add(2018);
        yearList.add(2019);

        orcaReport.put(OrcaReportParam.NULL_STRING, "...");
        orcaReport.put("peopleList", peopleList);
        orcaReport.put("differentPeopleList", differentPeopleList);
        orcaReport.put("yearList", yearList);
        orcaReport.put("hello", " Hello World!");

        byte[] output = orcaReport.render();
        writeTestResults(output);

    }
View Full Code Here

    @Test
    public void test() throws Exception {

        InputStream inputStream = getClass().getResourceAsStream("/TableWithTotals.docx");
        OrcaReport orcaReport = new DocXReport(inputStream);

        List<Expense> expenseList = expenseListGenerator(new Random().nextInt(5) + 5);

        orcaReport.put("MyUtil", new MyUtil());
        orcaReport.put("cityName", "Istanbul");
        orcaReport.put("value1", "val1");
        orcaReport.put("value2", "val2");
        orcaReport.put("expenseList", expenseList);

        byte[] output = orcaReport.render();
        writeTestResults(output);
    }
View Full Code Here

TOP

Related Classes of org.orcateam.report.engine.docx.DocXReport

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.