|
本帖最后由 xiongjun 于 2020-10-21 18:00 编辑
问题:帆软报表在页面显示 html 富文本没问题,但导出 pdf,会出现 html 标签、字体重叠、样式错乱的问题
解决办法:将报表的所有内容显示在一个页面,使用 js 调用浏览器打印或另存为 pdf
步骤:
1、在 frReport2/web 目录中加入 print.js
2、使用分析模式,报表访问 url 中添加参数 op=view,是报表内容显示在一个页面
3、模板 web 参数添加加载完成事件,调用打印接口,js 代码如下:
- $('head').append('<script src="./print.js"></script>');
- $('table').eq(0).print({
- globalStyles: true,
- mediaPrint: false,
- stylesheet: null,
- noPrintSelector: ".no-print",
- iframe: true,
- append: null,
- prepend: null,
- manuallyCopyFormValues: true,
- deferred: $.Deferred(),
- timeout: 750,
- title: null,
- doctype: '<!doctype html>'
- });
复制代码
4、访问加上 op=view 参数访问报表
缺点: pdf 文件的断页会有细节问题。
|
|