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\\"
);
}
}