Search in sources :

Example 6 with PivotTableReportElement

use of org.activityinfo.legacy.shared.reports.model.PivotTableReportElement in project activityinfo by bedatadriven.

the class DummyPivotTableData method Foobar1612Element.

public PivotTableReportElement Foobar1612Element() {
    PivotTableReportElement element = new PivotTableReportElement();
    element.setTitle("Foobar 1612");
    element.setRowDimensions(rowDims);
    element.setColumnDimensions(colDims);
    element.setContent(new PivotContent(table, new ArrayList<FilterDescription>()));
    return element;
}
Also used : ArrayList(java.util.ArrayList) PivotTableReportElement(org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)

Example 7 with PivotTableReportElement

use of org.activityinfo.legacy.shared.reports.model.PivotTableReportElement in project activityinfo by bedatadriven.

the class DummyPivotTableData2 method testElement.

public PivotTableReportElement testElement() {
    PivotTableReportElement element = new PivotTableReportElement();
    element.setTitle("Foobar 1612");
    element.setRowDimensions(rowDims);
    element.setColumnDimensions(colDims);
    element.setContent(new PivotContent(table, new ArrayList<FilterDescription>()));
    return element;
}
Also used : PivotContent(org.activityinfo.legacy.shared.reports.content.PivotContent) ArrayList(java.util.ArrayList) PivotTableReportElement(org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)

Example 8 with PivotTableReportElement

use of org.activityinfo.legacy.shared.reports.model.PivotTableReportElement in project activityinfo by bedatadriven.

the class PivotTableTemplate method createElement.

@Override
public void createElement(AsyncCallback<ReportElement> callback) {
    PivotTableReportElement table = new PivotTableReportElement();
    table.addColDimension(new DateDimension(DateUnit.YEAR));
    table.addColDimension(new DateDimension(DateUnit.MONTH));
    table.addRowDimension(new Dimension(DimensionType.Partner));
    callback.onSuccess(table);
}
Also used : Dimension(org.activityinfo.legacy.shared.reports.model.Dimension) DateDimension(org.activityinfo.legacy.shared.reports.model.DateDimension) PivotTableReportElement(org.activityinfo.legacy.shared.reports.model.PivotTableReportElement) DateDimension(org.activityinfo.legacy.shared.reports.model.DateDimension)

Example 9 with PivotTableReportElement

use of org.activityinfo.legacy.shared.reports.model.PivotTableReportElement in project activityinfo by bedatadriven.

the class PivotTableRendererTest method veryLongFilter.

@Test
public void veryLongFilter() {
    // input test data : element + content
    DummyPivotTableData2 testData = new DummyPivotTableData2();
    PivotTableReportElement element = testData.testElement();
    // Filtering on 4000 indicators....
    Map<Integer, String> labelMap = Maps.newHashMap();
    for (int i = 1; i != 10000; ++i) {
        element.getFilter().addRestriction(DimensionType.Indicator, i);
        labelMap.put(i, "Very long indicator name " + i);
    }
    element.getContent().getFilterDescriptions().add(new FilterDescription(DimensionType.Indicator, labelMap));
    // Destination book
    HSSFWorkbook book = new HSSFWorkbook();
    // CLASS under test
    ExcelPivotTableRenderer renderer = new ExcelPivotTableRenderer();
    renderer.render(book, element);
}
Also used : DummyPivotTableData2(org.activityinfo.server.report.DummyPivotTableData2) FilterDescription(org.activityinfo.legacy.shared.reports.content.FilterDescription) PivotTableReportElement(org.activityinfo.legacy.shared.reports.model.PivotTableReportElement) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) Test(org.junit.Test)

Example 10 with PivotTableReportElement

use of org.activityinfo.legacy.shared.reports.model.PivotTableReportElement in project activityinfo by bedatadriven.

the class PivotTableRendererTest method exportWithInvalidCharsInSheetnames.

// AI-1413
@Test
public void exportWithInvalidCharsInSheetnames() {
    PivotTableReportElement element = new DummyPivotTableData2().testElement();
    element.setTitle("CPSC: 4Ws");
    ExcelPivotTableRenderer renderer = new ExcelPivotTableRenderer();
    renderer.render(new HSSFWorkbook(), element);
}
Also used : DummyPivotTableData2(org.activityinfo.server.report.DummyPivotTableData2) PivotTableReportElement(org.activityinfo.legacy.shared.reports.model.PivotTableReportElement) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) Test(org.junit.Test)

Aggregations

PivotTableReportElement (org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)12 Test (org.junit.Test)8 Dimension (org.activityinfo.legacy.shared.reports.model.Dimension)5 ArrayList (java.util.ArrayList)4 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)4 DummyPivotTableData2 (org.activityinfo.server.report.DummyPivotTableData2)3 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 IOException (java.io.IOException)2 OutputStream (java.io.OutputStream)2 PivotSites (org.activityinfo.legacy.shared.command.PivotSites)2 Bucket (org.activityinfo.legacy.shared.command.result.Bucket)2 PivotContent (org.activityinfo.legacy.shared.reports.content.PivotContent)2 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)2 AdminDimension (org.activityinfo.legacy.shared.reports.model.AdminDimension)2 AttributeGroupDimension (org.activityinfo.legacy.shared.reports.model.AttributeGroupDimension)2 DispatcherSync (org.activityinfo.server.command.DispatcherSync)2 User (org.activityinfo.server.database.hibernate.entity.User)2 ReportChangeEvent (org.activityinfo.ui.client.page.report.ReportChangeEvent)2 Sheet (org.apache.poi.ss.usermodel.Sheet)2