public class DBReportProvider extends Object implements com.bstek.ureport.provider.report.ReportProvider, org.springframework.context.ApplicationContextAware
| 构造器和说明 |
|---|
DBReportProvider() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deleteReport(String file)
删除指定的报表文件
该方法会解析传入的文件路径字符串,验证其格式是否符合要求(必须包含两级目录和文件名,
格式为:xxx/yyy!
|
boolean |
disabled()
判断当前报告提供器是否被禁用
|
String |
getName()
获取报表系统的名称。
|
String |
getPrefix() |
List<com.bstek.ureport.provider.report.ReportFile> |
getReportFiles()
获取报表文件列表
|
InputStream |
loadReport(String file)
加载报表文件并返回输入流
|
void |
saveReport(String file,
String content)
保存报表内容到数据库
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
设置应用上下文,并初始化文件存储目录。
|
void |
setDisabled(boolean disabled)
设置报表是否禁用状态
|
void |
setFileStoreDir(String fileStoreDir)
设置文件存储目录
|
public InputStream loadReport(String file)
loadReport 在接口中 com.bstek.ureport.provider.report.ReportProviderfile - 报表文件路径,格式为"/目录名/报表名!报表类型"com.bstek.ureport.exception.ReportException - 当文件格式不正确或报表不存在时抛出异常public void deleteReport(String file)
该方法会解析传入的文件路径字符串,验证其格式是否符合要求(必须包含两级目录和文件名, 格式为:xxx/yyy!zzz),然后调用uReportService删除对应的报表。
deleteReport 在接口中 com.bstek.ureport.provider.report.ReportProviderfile - 要删除的报表文件路径,格式应为:一级目录/二级目录!文件名!扩展名com.bstek.ureport.exception.ReportException - 当文件格式不正确或数据库操作出错时抛出RuntimeException - 当业务异常发生时抛出public List<com.bstek.ureport.provider.report.ReportFile> getReportFiles()
getReportFiles 在接口中 com.bstek.ureport.provider.report.ReportProviderpublic String getName()
getName 在接口中 com.bstek.ureport.provider.report.ReportProviderpublic void saveReport(String file, String content)
saveReport 在接口中 com.bstek.ureport.provider.report.ReportProviderfile - 文件路径,格式应为"目录/类型/名称!扩展名"(例如:report/type/name!ext)content - 要保存的报表内容com.bstek.ureport.exception.ReportException - 当文件格式不正确或保存过程中出现错误时抛出
1. 文件路径格式不正确时抛出
2. 数据库操作异常时抛出包含SQL错误信息的异常
3. 业务异常时抛出原始业务异常public boolean disabled()
disabled 在接口中 com.bstek.ureport.provider.report.ReportProviderpublic void setDisabled(boolean disabled)
disabled - true表示禁用报表,false表示启用报表public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext 在接口中 org.springframework.context.ApplicationContextAwareapplicationContext - 应用上下文对象,用于获取应用环境信息org.springframework.beans.BeansException - 当处理应用上下文时发生异常public void setFileStoreDir(String fileStoreDir)
fileStoreDir - 文件存储目录路径public String getPrefix()
getPrefix 在接口中 com.bstek.ureport.provider.report.ReportProviderCopyright © 2025. All rights reserved.