From 230f9aac60c61e41cea715258bbcc8004a39abc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Wed, 12 May 2021 08:50:20 +0800 Subject: [PATCH] commit --- ...rg_checkerframework_checker_qual_3_5_0.xml | 13 +++++ ...ven__org_postgresql_postgresql_42_2_20.xml | 13 +++++ RunQianUpdate/RunQianUpdate.iml | 4 +- RunQianUpdate/pom.xml | 6 +++ RunQianUpdate/src/Test.java | 46 ++++++++++++++++++ RunQianUpdate/target/classes/Test.class | Bin 0 -> 2961 bytes 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 RunQianUpdate/.idea/libraries/Maven__org_checkerframework_checker_qual_3_5_0.xml create mode 100644 RunQianUpdate/.idea/libraries/Maven__org_postgresql_postgresql_42_2_20.xml create mode 100644 RunQianUpdate/src/Test.java create mode 100644 RunQianUpdate/target/classes/Test.class diff --git a/RunQianUpdate/.idea/libraries/Maven__org_checkerframework_checker_qual_3_5_0.xml b/RunQianUpdate/.idea/libraries/Maven__org_checkerframework_checker_qual_3_5_0.xml new file mode 100644 index 00000000..b41c4fe5 --- /dev/null +++ b/RunQianUpdate/.idea/libraries/Maven__org_checkerframework_checker_qual_3_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/RunQianUpdate/.idea/libraries/Maven__org_postgresql_postgresql_42_2_20.xml b/RunQianUpdate/.idea/libraries/Maven__org_postgresql_postgresql_42_2_20.xml new file mode 100644 index 00000000..1e7ede13 --- /dev/null +++ b/RunQianUpdate/.idea/libraries/Maven__org_postgresql_postgresql_42_2_20.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/RunQianUpdate/RunQianUpdate.iml b/RunQianUpdate/RunQianUpdate.iml index 0f70efdc..d26ca521 100644 --- a/RunQianUpdate/RunQianUpdate.iml +++ b/RunQianUpdate/RunQianUpdate.iml @@ -9,6 +9,7 @@ + @@ -40,6 +41,7 @@ - + + \ No newline at end of file diff --git a/RunQianUpdate/pom.xml b/RunQianUpdate/pom.xml index eff83120..9ba39191 100644 --- a/RunQianUpdate/pom.xml +++ b/RunQianUpdate/pom.xml @@ -113,6 +113,12 @@ ant 1.9.7 + + + org.postgresql + postgresql + 42.2.20 + diff --git a/RunQianUpdate/src/Test.java b/RunQianUpdate/src/Test.java new file mode 100644 index 00000000..91905758 --- /dev/null +++ b/RunQianUpdate/src/Test.java @@ -0,0 +1,46 @@ +import com.raqsoft.dm.Sequence; +import com.raqsoft.report.model.ReportDefine; +import com.raqsoft.report.usermodel.Context; +import com.raqsoft.report.usermodel.Engine; +import com.raqsoft.report.usermodel.IReport; +import com.raqsoft.report.util.ReportUtils; +import com.raqsoft.report.view.ReportExporter; + +import java.io.File; +import java.io.FileInputStream; +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; + +public class Test { + public static void main(String[] args) throws Throwable { + // 设置报表授权文件 + File flic = new File("./reportTrialLicense20211231.xml"); + FileInputStream lis = new FileInputStream(flic); + Sequence.readLicense(Sequence.P_RPT, lis); + + //加载报表 + String reportFile = "E:\\Work\\dsMin\\Report2020\\001各级各类教育校数、教职工数、专任教师情况.rpx"; //该文件名可以为绝对路径,也可以相对当前程序启动路径 + ReportDefine rd = (ReportDefine) ReportUtils.read(reportFile); + + //构建报表引擎计算环境 + Context cxt = new Context(); + Connection con = null; + try { + Driver driver = (Driver) Class.forName("org.postgresql.Driver").newInstance(); + DriverManager.registerDriver(driver); + con = DriverManager.getConnection("jdbc:postgresql://10.10.14.206:5432/eduData_db", "root", "DsideaL147258369"); + } catch (Exception e) { + e.printStackTrace(); + } + cxt.setConnection("HUANGHAI", con); //这样设定默认数据源 + cxt.setDefDataSourceName("HUANGHAI"); + + Engine engine = new Engine(rd, cxt); //构造报表引擎 + IReport iReport = engine.calc(); //运算报表 + ReportExporter re = new ReportExporter("c:\\1.xls", ReportExporter.EXPORT_EXCEL); //导出为Excel + re.export(iReport); //导出 + + System.out.println("恭喜,导出成功!"); + } +} diff --git a/RunQianUpdate/target/classes/Test.class b/RunQianUpdate/target/classes/Test.class new file mode 100644 index 0000000000000000000000000000000000000000..6efde3247c8663c8dc3a65d4c3ccfeb8e09eeda7 GIT binary patch literal 2961 zcma)8ZC4Xl5PlXyZdez=0BWlB4b-5LgcnhxwpBo-P0$KLskFKzOIS>H!)8HzX)C_h zT5D_7+S;mZJ$~x3dQO2Oo*qB5*55i0s! zIOIayg#`c77<3T}kaS^ys~CJpF_{s%zY^Y{Y1z(j0bavNx_q1kAN{Ro%ZsjVq*-ALq__W{6v~>C;WyykkWfizpdj>5KwXdUdup}(o1;pEhEFGfK|EH z52h5u)@jr=QyJ!X~*A) zXOMkwF8f2OayWgw=3$PKV$k}cHdBrq3d>200SpbqYvMD*Nt?Y4r-+z@?DOamCr=9~ z2`grw9^E4wazY_f6d18hA2cG04SpeKkdFsIf)`Z+Br6!{U71dNB&h@z#G z+CXhhO>JF`Z#WU>YG(v2$X3e=HlIFA)7gQHCj4#6z@VZ<6ba{WUO;zqu)9+?4s}OU zVO8t4QKDS}-GM;OAN*!^aXX;1h~xwikxQpd54(P?=-hEE*AibR*_V>M1j3C`2Nk zoly)IC47oY5dS7jzA-KN2uGX(a z2b*M5J`nApd^2>NSYFbUQlp9-s;S>lyMAL`!zKw|;wmMnwUd?l&q*NR8V{;#*S>A7 zJ9lksk#HSfNw~p7R`JqP+T`Zp`&z;`xJlg3u|5Y`X}3tQo465AaqVv$x>ip%&3%8y<9%1-F!jIfB2j?W6GjpEZJ^hrOGemZE zn?Ci-9G;e1ShV*U`eD14mV0NH8eSgfrRCEljLYUwsfwogPQ}c-{dqadVz*UXbK+>K z(=}=zy;9aWxIF>ETrT7)0~x+$iiXW4>r{<#IYm}kuWqzbW)rt_8qPpyDNrGqqbY}5 zw3I1R_6aESR%JnA!%U0jzd+istjRInKjs=rOifW8vANC-*!mfQTbLBZ6f;v(1%z{W zm$h-aRn3;9y_*?car~<|ipi&D?R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