Search in sources :

Example 6 with FilterDescription

use of org.activityinfo.legacy.shared.reports.content.FilterDescription 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)

Aggregations

FilterDescription (org.activityinfo.legacy.shared.reports.content.FilterDescription)6 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)2 Cell (org.apache.poi.ss.usermodel.Cell)2 Row (org.apache.poi.ss.usermodel.Row)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 DimensionType (org.activityinfo.legacy.shared.command.DimensionType)1 GetDimensionLabels (org.activityinfo.legacy.shared.command.GetDimensionLabels)1 DimensionLabels (org.activityinfo.legacy.shared.command.GetDimensionLabels.DimensionLabels)1 SiteDTO (org.activityinfo.legacy.shared.model.SiteDTO)1 ReportContent (org.activityinfo.legacy.shared.reports.content.ReportContent)1 TableData (org.activityinfo.legacy.shared.reports.content.TableData)1 PivotTableReportElement (org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)1 TableColumn (org.activityinfo.legacy.shared.reports.model.TableColumn)1 DummyPivotTableData2 (org.activityinfo.server.report.DummyPivotTableData2)1 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)1 Before (org.junit.Before)1 Test (org.junit.Test)1