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

  1. package com.anyrt.sdk;
  2. import com.anyrt.report.service.AppContext;
  3. import com.anyrt.report.service.ExportFile;
  4. import com.anyrt.report.service.ReportMgrService;
  5. import com.anyrt.report.service.ReportService;
  6. import com.anyrt.report.service.ReportServiceManager;
  7. import com.anyrt.system.service.SystemService;
  8. public class ServiceManager {
  9. public static SystemService getSystemService() {
  10. SystemService systemService = (SystemService) AppContext
  11. .getObject(SystemService.NAME);
  12. return systemService;
  13. }
  14. //xls,xlsx,ppt,doc,pdf
  15. public static ExportFile getExportFile(String suffix) {
  16. return ReportServiceManager.createExportAbleByName(suffix);
  17. }
  18. public static ReportMgrService getReportMgrService() {
  19. ReportMgrService reportService = (ReportMgrService) AppContext
  20. .getObject(ReportMgrService.NAME);
  21. return reportService;
  22. }
  23. public static ReportService getReportService() {
  24. ReportService reportService = (ReportService) AppContext
  25. .getObject(ReportMgrService.NAME);
  26. return reportService;
  27. }
  28. public static Object getService(String name) {
  29. return AppContext.getObject(name);
  30. }
  31. }