1.JavaAPI
AnyReport 提供JAVA API供外部JAVA集成系统调用,可管理用户信息、数据源、报表等
1.1 Service类
服务接口 描述
SystemService 系统管理服务类,用户管理、角色管理、组织管理、权限等
ReportMgrService 报表模板管理、添加数据源、生成数据集等
ReportService 获取报表数据、查询单元格数据、获取参数页面等
ExportFile 输出文件支持xls、xlsx、ppt、doc、pdf
1.2 获取服务对象
通过com.anyrt.sdk包下的 ServiceManager 服务管理类获取Service
package com.anyrt.sdk;
import com.anyrt.report.service.AppContext;
import com.anyrt.report.service.ExportFile;
import com.anyrt.report.service.ReportMgrService;
import com.anyrt.report.service.ReportService;
import com.anyrt.report.service.ReportServiceManager;
import com.anyrt.system.service.SystemService;
public class ServiceManager {
public static SystemService getSystemService() {
SystemService systemService = (SystemService) AppContext
.getObject(SystemService.NAME);
return systemService;
}
//xls,xlsx,ppt,doc,pdf
public static ExportFile getExportFile(String suffix) {
return ReportServiceManager.createExportAbleByName(suffix);
}
public static ReportMgrService getReportMgrService() {
ReportMgrService reportService = (ReportMgrService) AppContext
.getObject(ReportMgrService.NAME);
return reportService;
}
public static ReportService getReportService() {
ReportService reportService = (ReportService) AppContext
.getObject(ReportMgrService.NAME);
return reportService;
}
public static Object getService(String name) {
return AppContext.getObject(name);
}
}