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);
}