public class FileReportProvider extends Object implements com.bstek.ureport.provider.report.ReportProvider, org.springframework.context.ApplicationContextAware
| 构造器和说明 |
|---|
FileReportProvider() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deleteReport(String file)
删除指定报告文件
该方法根据传入的文件路径格式验证后,调用uReportService删除对应的报告文件。
|
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 - 报表文件路径,格式应为:类型/目录名/报表名!报表版本(例如:report/sales/monthly!2023)com.bstek.ureport.exception.ReportException - 当文件格式不正确或报表不存在时抛出异常public void deleteReport(String file)
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. 数据库操作异常或业务异常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 - 应用上下文对象,用于获取Web相关资源(当前代码未实际使用)org.springframework.beans.BeansException - 如果处理应用上下文时发生异常public void setFileStoreDir(String fileStoreDir)
fileStoreDir - 文件存储目录的路径public String getPrefix()
getPrefix 在接口中 com.bstek.ureport.provider.report.ReportProviderCopyright © 2025. All rights reserved.