Programmatic reports
The report creation is a tedious and non-productive task. You need an IDE, create a connection, create a SQL query, define report bands, drag-and-drop/design report columns, fields, labels, summarizations, margins, charts and prepare perfect pixel reports for print. To create a tradicional report the effort takes 4 to 12 hours.
The idea is to define reports using object script instructions. With some minutes and with writing a few object script lines you can get a report equivalent to a tradicional report, with the benefit to create dynamic content for the reports (productivity).
The idea includes yet the feature to allows to the developer set print restrictions for the PDF report generated (reduce carbon emission, not allowing print, only read).
Benefits of this idea:
1 - Productivity - develop a report in minutes not in hours
2 - Reduce carbon emission - is possible restrict the PDF print
3 - Create dynamic reports using ObjectScript
4 - No need to install a report server, saving processor and memory resources (decreasing emissions)
To create a report using source code, see this sample with Java, but could be in ObjectScript too:
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());
TextColumnBuilder<Date> orderDateColumn = col.column("Order date", "orderdate", type.dateType());
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType()).setFixedWidth(50);
TextColumnBuilder<BigDecimal> unitPriceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
ColumnTitleGroupBuilder titleGroup2 = grid.titleGroup("Group 2", quantityColumn, unitPriceColumn);
ColumnTitleGroupBuilder titleGroup1 = grid.titleGroup("Group 1", orderDateColumn, titleGroup2).setTitleFixedWidth(450);
report()
.setTemplate(Templates.reportTemplate)
.columnGrid(itemColumn, titleGroup1)
.columns(itemColumn, orderDateColumn, quantityColumn, unitPriceColumn)
.title(Templates.createTitleComponent("ColumnTitleGroup"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.setSecurityRule(PrintRule.READ_ONLY) //if you want restrict print
.printPDF();