报表中不支持拖放checkbox组件,因此要显示复选框可以用图片的方式实现
1.可以在UI2下放选中和为选中状态的图片,然后在reportData关联的action的ksql或者sql中通过case when设置字段不同的值显示不同的图片路径(选中或未选中),如下:
public static Table checkBoxImage() {
String ksql = "select docKind.fName,docKind.fCode,docKind.fUseStatusName," +
"case when docKind.fUseStatus = 1 then '/UI2/appdemo/test/process/checkboxImage/check.png' " +
"else '/UI2/appdemo/test/process/checkboxImage/uncheck.png' end AS fUseStatus " +
"from DEMO_DocKind docKind";
Table table = KSQL.select(ksql, null, "/demo/misc/data", null);
return table;
}
2.在report组件的excel文件中设置fUseStatus列所在的单元格为批注为display-type:image,如下:


评一波