易截截图软件、单文件、免安装、纯绿色、仅160KB

快逸报表导出成XML文件


快逸报表有着强大的输出功能,可以直接把web报表导出为Excel、Word、Pdf、Txt等文件形式。但是一些web报表用户希望可以将报表导出到XML文件中以便对数据进行分析与解析,这样就需要我们用一些特殊的方法去实现了。
实现思路
:导出XML功能的可以通过将计算好的IReport对象传递给快逸提供的com.runqian.report4.view.xml.XMLReport类下的export()方法来实现导出。
 
下面根据思路来做一个例子,实现步骤如下:
首先打开任何一张已经制作好的快逸报表。
先看下该报表页面展现的效果,如下图:
然后只需在展现报表的jsp中加入下面代码:
Context ctx = new Context();//构建报表引擎计算环境
String path = “C:/api/reportFiles/demo.raq”; //该文件名可以为绝对路径,也可以相对当前程序启动路径
ReportDefine rd = (ReportDefine) ReportUtils.read(path);//读取报表
Engine engine = new Engine(rd, ctx); //构造报表引擎
IReport report = engine.calc();//运算报表
XMLReport xml = new XMLReport();//创建导出XML类的实例
xml.export(report);//将计算好的报表传递给xml类的export方法中
xml.saveTo(”C:/demo.xml”);//xml文件数据路径(也可以使用OutputStream输出)
 
一段简单的代码就可以实现将报表导出到XML文件中,下面我们看下XML文件中导入的内容,如下图:
这样页面中各式各样的报表导出到XML后就被规范成了XML格式的数据,方便了开发人员进行数据的分析和解析了。
原文链接:快逸报表导出成XML文件


相关文档:

XML第二课

wsdl.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<definitions  name="MobilePhoneService"
     targetNamespace="www.mobilephoneservice.com/MobilePhoneService-interface"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     ......

flex xml遍历

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:XML id="xmlSource">
    <node label="grandFather" state="unchecked">
        <node label="Father" state="un ......

解析xml文件的几种常见的方法

xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<mobile-list>
<mobile type="Nokia2652">
<wap2>false</wap2>
<width>115</width>
</mobile>
<mobile type="Nokia2650">
......

php之XML转数组函数

<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号