Search in sources :

Example 11 with PivotChartReportElement

use of org.activityinfo.shared.report.model.PivotChartReportElement in project activityinfo by bedatadriven.

the class JaxbParseTest method testElements.

@Test
public void testElements() throws JAXBException {
    Report report = parseXml("report-elements.xml");
    dumpXml(report);
    Assert.assertEquals("element count", 7, report.getElements().size());
    Assert.assertTrue("pivotTable", report.getElements().get(0) instanceof PivotTableReportElement);
    Assert.assertTrue("pivotChart", report.getElements().get(1) instanceof PivotChartReportElement);
    Assert.assertTrue("table", report.getElements().get(2) instanceof TableElement);
    Assert.assertTrue("map", report.getElements().get(3) instanceof MapReportElement);
    Assert.assertTrue("static", report.getElements().get(4) instanceof TextReportElement);
    Assert.assertTrue("static", report.getElements().get(5) instanceof TextReportElement);
    Assert.assertTrue("static", report.getElements().get(6) instanceof ImageReportElement);
}
Also used : MapReportElement(org.activityinfo.shared.report.model.MapReportElement) ImageReportElement(org.activityinfo.shared.report.model.ImageReportElement) Report(org.activityinfo.shared.report.model.Report) PivotChartReportElement(org.activityinfo.shared.report.model.PivotChartReportElement) PivotTableReportElement(org.activityinfo.shared.report.model.PivotTableReportElement) TableElement(org.activityinfo.shared.report.model.TableElement) TextReportElement(org.activityinfo.shared.report.model.TextReportElement) Test(org.junit.Test)

Example 12 with PivotChartReportElement

use of org.activityinfo.shared.report.model.PivotChartReportElement in project activityinfo by bedatadriven.

the class ItextReportRendererTest method chartTest.

@Test
public void chartTest() throws IOException {
    DummyPivotTableData data = new DummyPivotTableData();
    PivotChartContent chartContent = new PivotChartContent();
    chartContent.setData(data.table);
    chartContent.setYMin(0);
    chartContent.setYStep(100);
    chartContent.setFilterDescriptions(Collections.EMPTY_LIST);
    PivotChartReportElement chart = new PivotChartReportElement(Type.Pie);
    chart.setTitle("My Pie Chart");
    chart.setCategoryDimensions(data.colDims);
    chart.setSeriesDimensions(data.rowDims);
    chart.setContent(chartContent);
    ReportContent content = new ReportContent();
    content.setFilterDescriptions(Collections.EMPTY_LIST);
    Report report = new Report();
    report.setContent(content);
    report.addElement(chart);
    renderToPdf(report, "chartTest.pdf");
    renderToRtf(report, "chartTest.rtf");
}
Also used : ReportContent(org.activityinfo.shared.report.content.ReportContent) Report(org.activityinfo.shared.report.model.Report) DummyPivotTableData(org.activityinfo.server.report.DummyPivotTableData) PivotChartReportElement(org.activityinfo.shared.report.model.PivotChartReportElement) PivotChartContent(org.activityinfo.shared.report.content.PivotChartContent) Test(org.junit.Test)

Aggregations

PivotChartReportElement (org.activityinfo.shared.report.model.PivotChartReportElement)12 Report (org.activityinfo.shared.report.model.Report)6 Test (org.junit.Test)6 PivotTableReportElement (org.activityinfo.shared.report.model.PivotTableReportElement)5 MapReportElement (org.activityinfo.shared.report.model.MapReportElement)4 JsonArray (com.google.gson.JsonArray)2 JsonElement (com.google.gson.JsonElement)2 JsonObject (com.google.gson.JsonObject)2 DummyPivotTableData (org.activityinfo.server.report.DummyPivotTableData)2 PivotChartContent (org.activityinfo.shared.report.content.PivotChartContent)2 ReportContent (org.activityinfo.shared.report.content.ReportContent)2 ReportElement (org.activityinfo.shared.report.model.ReportElement)2 TableElement (org.activityinfo.shared.report.model.TableElement)2 TextReportElement (org.activityinfo.shared.report.model.TextReportElement)2 DispatcherSync (org.activityinfo.server.command.DispatcherSync)1 IndicatorDAO (org.activityinfo.server.database.hibernate.dao.IndicatorDAO)1 Indicator (org.activityinfo.server.database.hibernate.entity.Indicator)1 User (org.activityinfo.server.database.hibernate.entity.User)1 PivotChartGenerator (org.activityinfo.server.report.generator.PivotChartGenerator)1 Filter (org.activityinfo.shared.command.Filter)1