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;
 }
Ejemplo n.º 2
0
 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;
 }