private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("id", "item", "orderdate", "quantity", "unitprice"); dataSource.add(5, "Notebook", new Date(), 1, new BigDecimal(500)); dataSource.add(8, "Book", new Date(), 7, new BigDecimal(300)); dataSource.add(15, "PDA", new Date(), 2, new BigDecimal(250)); return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2", "field3", "field4", "field5"); dataSource.add(1, "2", 3, 4, 5); dataSource.add(1, "very very very very very very very long value 2", 3, 4, 5); return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("item", "stock1", "stock2", "stock3"); dataSource.add("Laptop", 95, 80, 50); dataSource.add("Tablet", 170, 100, 80); dataSource.add("Smartphone", 120, 80, 60); return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("x", "y", "z"); for (int i = 0; i < 10; i++) { dataSource.add(i, 0, (int) (Math.random() * 4)); dataSource.add(i, 1, (int) (Math.random() * 4)); } return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2"); for (int i = 0; i < 10; i++) { dataSource.add("group1", i); } return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1"); dataSource.add(true); dataSource.add(false); dataSource.add(); return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2", "field3"); for (int i = 0; i < 20; i++) { dataSource.add(i, i + 1, i + 2); } return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("item", "quantity", "unitprice"); for (int i = 0; i < 20; i++) { dataSource.add( "Book", (int) (Math.random() * 10) + 1, new BigDecimal(Math.random() * 100 + 1)); } return dataSource; }
protected JRDataSource createDataSource2() { DRDataSource dataSource = new DRDataSource("field1", "field2"); dataSource.add("text4", 6); dataSource.add("text1", 3); dataSource.add("text3", 8); dataSource.add("text2", 1); dataSource.add("text3", 2); return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2"); dataSource.add("3", "text4"); dataSource.add("1", "text1"); dataSource.add("3", "text3"); dataSource.add("2", "text2"); return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2", "field3"); dataSource.add("value1", "value1_1", 5); dataSource.add("value1", "value1_1", 6); dataSource.add("value1", "value1_2", 7); dataSource.add("value2", "value2_1", 8); dataSource.add("value2", "value2_2", 9); return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("column1", "column2"); int row = 1; for (int i = 1; i <= 2; i++) { for (int j = 0; j < 50; j++) { dataSource.add("group" + i, "row " + row++); } } return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("staff", "absent", "present"); for (int i = 0; i < staffTotalAttendances.size(); i++) { String name = staffTotalAttendances.get(i).getStaff().getFirstName() + " " + staffTotalAttendances.get(i).getStaff().getLastName(); int present = staffTotalAttendances.get(i).getTotalPresentDays(); int absent = staffTotalAttendances.get(i).getTotalAbsentDays(); dataSource.add(name, absent, present); } return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2", "field3", "field4", "field5", "field6", "field7"); Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_MONTH, -3); dataSource.add("serie", date1 = c.getTime(), 50d, 35d, 40d, 47d, 70d); c.add(Calendar.DAY_OF_MONTH, 1); dataSource.add("serie", date2 = c.getTime(), 55d, 40d, 50d, 45d, 120d); c.add(Calendar.DAY_OF_MONTH, 1); dataSource.add("serie", date3 = c.getTime(), 48d, 41d, 42d, 47d, 90d); return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("year", "quarter", "stock1", "stock2", "stock3"); dataSource.add("2010", "Q1", 80, 25, 18); dataSource.add("2010", "Q2", 98, 78, 22); dataSource.add("2010", "Q3", 50, 10, 89); dataSource.add("2010", "Q4", 121, 40, 43); dataSource.add("2011", "Q1", 103, 120, 34); dataSource.add("2011", "Q2", 190, 95, 22); dataSource.add("2011", "Q3", 43, 109, 51); dataSource.add("2011", "Q4", 80, 88, 40); return dataSource; }
private static JRDataSource createDataSource(String lastName, String firstName) { final List<GivingRecord> records = RecordManager.getInstance().getRecordsForName(lastName, firstName); final List<String> columnList = new ArrayList<String>(); columnList.add("date"); columnList.add("fundType"); columnList.add("checkNumber"); final List<String> categories = Settings.getInstance().getCategories(); columnList.addAll(categories); columnList.add("total"); final String[] columns = new String[columnList.size()]; columnList.toArray(columns); final DRDataSource dataSource = new DRDataSource(columns); for (GivingRecord record : records) { final List<Object> data = new ArrayList<Object>(); data.add(record.getDateString()); data.add(record.getFundType()); if (record.getCheckNumber().isEmpty()) { data.add(null); } else { data.add(Short.parseShort(record.getCheckNumber())); } for (String category : categories) { final BigDecimal amount = new BigDecimal(record.getAmountForCategory(category)); data.add(amount); } data.add(new BigDecimal(record.getTotal())); dataSource.add(data.toArray()); } return dataSource; }
private JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("date", "stock1", "stock2"); dataSource.add(toDate(2010, 1), 25, 300); dataSource.add(toDate(2010, 2), 11, 450); dataSource.add(toDate(2010, 3), 17, 280); dataSource.add(toDate(2010, 4), 15, 620); dataSource.add(toDate(2010, 5), 30, 400); dataSource.add(toDate(2010, 6), 8, 320); dataSource.add(toDate(2010, 7), 25, 490); return dataSource; }
private JRDataSource createDataSourceBar(BigDecimal bdDato) { DRDataSource dataSource = new DRDataSource("evaluacion", "relacion", "cantidad"); dataSource.add("eva", "PROM", bdDato.doubleValue()); return dataSource; }
@Override protected JRDataSource createDataSource() { DRDataSource dataSource = new DRDataSource("field1", "field2", "field3"); dataSource.add("text", 1, "text"); return dataSource; }
private JRDataSource createDataSource(String text) { DRDataSource dataSource = new DRDataSource("field1"); dataSource.add(text); return dataSource; }