master
黄海 4 years ago
parent 588ceca7d2
commit 571198c3ec

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Config Version="2">
<Runtime>
<DBList encryptLevel="0">
<DB name="HUANGHAI">
<property name="url" value="jdbc:postgresql://10.10.14.206:5432/eduData_db"/>
<property name="driver" value="org.postgresql.Driver"/>
<property name="type" value="15"/>
<property name="user" value="root"/>
<property name="password" value="DsideaL147258369"/>
<property name="batchSize" value="1000"/>
<property name="autoConnect" value="true"/>
<property name="useSchema" value="false"/>
<property name="addTilde" value="false"/>
<property name="dbCharset" value="GBK"/>
<property name="clientCharset" value="GBK"/>
<property name="needTransContent" value="false"/>
<property name="needTransSentence" value="false"/>
<property name="caseSentence" value="false"/>
</DB>
</DBList>
<Esproc>
<license/>
<charSet/>
<dfxPathList>
<dfxPath>web/webapps/demo/WEB-INF/reportFiles</dfxPath>
</dfxPathList>
<dateFormat>yyyy-MM-dd</dateFormat>
<timeFormat>HH:mm:ss</timeFormat>
<dateTimeFormat>yyyy-MM-dd HH:mm:ss</dateTimeFormat>
<mainPath/>
<tempPath/>
<bufSize>65536</bufSize>
<localHost/>
<localPort>0</localPort>
<parallelNum>1</parallelNum>
<simpleTableBlockSize/>
<nullStrings>nan,null,n/a</nullStrings>
<fetchCount/>
<extLibsPath/>
</Esproc>
<Report>
<license>C:\Users\Administrator\Desktop\reportTrialLicense20211231.xml</license>
<home/>
<styleConfig>C:/Program Files/raqsoft/report/tmp/reportStyleConfig.xml</styleConfig>
<NaNDisp>NaN</NaNDisp>
<useOldRule>false</useOldRule>
</Report>
<Logger>
<Level/>
</Logger>
</Runtime>
</Config>

@ -1,9 +1,11 @@
import com.raqsoft.dm.Sequence; import com.raqsoft.dm.Sequence;
import com.raqsoft.report.model.ReportDefine; import com.raqsoft.report.model.ReportDefine;
import com.raqsoft.report.usermodel.Context; import com.raqsoft.report.usermodel.Context;
import com.raqsoft.report.usermodel.DataSourceConfig;
import com.raqsoft.report.usermodel.Engine; import com.raqsoft.report.usermodel.Engine;
import com.raqsoft.report.usermodel.IReport; import com.raqsoft.report.usermodel.IReport;
import com.raqsoft.report.util.ReportUtils; import com.raqsoft.report.util.ReportUtils;
import com.raqsoft.report.util.StyleConfig;
import com.raqsoft.report.view.ReportExporter; import com.raqsoft.report.view.ReportExporter;
import java.io.File; import java.io.File;
@ -20,7 +22,7 @@ public class Test {
Sequence.readLicense(Sequence.P_RPT, lis); Sequence.readLicense(Sequence.P_RPT, lis);
//加载报表 //加载报表
String reportFile = "E:\\Work\\dsMin\\Report2020\\001各级各类教育校数、教职工数、专任教师情况.rpx"; //该文件名可以为绝对路径,也可以相对当前程序启动路径 String reportFile = "E:\\Work\\dsMin\\RunQianUpdate\\001.rpx"; //该文件名可以为绝对路径,也可以相对当前程序启动路径
ReportDefine rd = (ReportDefine) ReportUtils.read(reportFile); ReportDefine rd = (ReportDefine) ReportUtils.read(reportFile);
//构建报表引擎计算环境 //构建报表引擎计算环境
@ -35,11 +37,9 @@ public class Test {
} }
cxt.setConnection("HUANGHAI", con); cxt.setConnection("HUANGHAI", con);
cxt.setDefDataSourceName("HUANGHAI");//这样设定默认数据源 cxt.setDefDataSourceName("HUANGHAI");//这样设定默认数据源
Engine engine = new Engine(rd, cxt); //构造报表引擎 Engine engine = new Engine(rd, cxt); //构造报表引擎
System.out.println("cccc");
IReport iReport = engine.calc(); //运算报表 IReport iReport = engine.calc(); //运算报表
System.out.println("dddd");
ReportExporter re = new ReportExporter("c:\\1.xls", ReportExporter.EXPORT_EXCEL); //导出为Excel ReportExporter re = new ReportExporter("c:\\1.xls", ReportExporter.EXPORT_EXCEL); //导出为Excel
re.export(iReport); //导出 re.export(iReport); //导出

@ -0,0 +1,2 @@
mvn -f pom.xml dependency:copy-dependencies -DoutputDirectory=lib
pause
Loading…
Cancel
Save