【仅供内部供应商使用,不提供对外解答和培训】
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
public class XmlExporter extends AbstractAppExporter {
@Override
public void export(OutputStream out, ResultWorkBook book) throws Exception {
// 不分页导出的实现
}
@Override
public void export(java.io.OutputStream out, PageSetProvider pageSet) throws Exception {
// 分页导出的实现
}
} |
给contentPane(分页预览、填报预览)的web对象增加导出函数:给contentPane(分页预览、填报预览)的web对象增加导出函数:
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
(function($){
// 你好啊,导出
$.extend(FR.WritePane.prototype, {
exportReportToXML : function() {
if (this.fireEvent("beforexml") === false) {
return;
}
var self = this;
this.saveReport(function () {
window.location = FR.servletURL + "?op=export&sessionID=" + self.currentSessionID + "&format=xml";
FR.progressBar(self.currentSessionID,"xml");
self.fireEvent("afterxml");
});
}
});
$.extend(FR.PagePane.prototype, {
exportReportToXML : function() {
if (this.fireEvent("beforexml") === false) {
return;
}
window.location = FR.servletURL + "?op=export&sessionID=" + this.currentSessionID + "&format=xml";
FR.progressBar(this.currentSessionID, "xml");
this.fireEvent("afterxml");
}
});
})(jQuery); |
...
完成上面的所有工作后,打包好插件并安装上,就可以在设计器中Web属性配置界面添加XML导出按钮了,预览模板的时候,就可以直接点击这个按钮将报表导出成xml文件,同样的,也可以和其他的url直接导出方式一样,给url后加参数&format=xml,直接将报表导出成xml文件。
...
完整的示例源码参照这里:http://git.fanruan.com/fanruan/demo-export-xml