UReport2 查询条件转换
Luck-Report 调整了查询条件配置功能,原 UReport2 报表若已配置查询条件,需转换后方可在 Luck-Report 中打开和预览。
转换方法
使用工具类 com.luck.report.web.utils.TransformUReportUtils 进行转换。
单个文件转换
java
public static void transformXmlFile(String inputFilePath, String outputDirPath)参数说明:
inputFilePath:UReport2 报表文件路径outputDirPath:转换后文件保存目录
使用示例:
java
public class TransformDemo {
public static void main(String[] args) {
TransformUReportUtils.transformXmlFile(
"D:\\report\\old-report.xml",
"E:\\report\\converted\\"
);
}
}批量转换文件夹
java
public static void transformXmlFolder(String inputFolderPath, String outputFolderPath)参数说明:
inputFolderPath:UReport2 报表文件夹路径outputFolderPath:转换后文件保存文件夹路径
使用示例:
java
public class TransformDemo {
public static void main(String[] args) {
TransformUReportUtils.transformXmlFolder(
"D:\\report\\",
"E:\\report\\converted\\"
);
}
}