From dffdee7ee17050093b587c324b29d3a53df3e91c Mon Sep 17 00:00:00 2001 From: esoe Date: Fri, 10 Jun 2022 17:27:01 +0300 Subject: [PATCH] qq --- report.xlsx | Bin 7571 -> 7570 bytes src/main/java/ru/egspt/ReportControls.java | 32 +++++++++++++++++- src/main/java/ru/egspt/ReportPane.java | 25 ++++++++++++++ target/classes/ru/egspt/ReportControls.class | Bin 980 -> 1944 bytes target/classes/ru/egspt/ReportPane.class | Bin 6388 -> 6813 bytes .../classes/ru/egspt/ReportTableModel.class | Bin 7843 -> 8021 bytes 6 files changed, 56 insertions(+), 1 deletion(-) diff --git a/report.xlsx b/report.xlsx index b896e3254fe77fb2b42265cf603bc184cfdd8782..813bda24c725fc3b029518fb891556af42e26384 100644 GIT binary patch delta 568 zcmbPiJ;|CUz?+#xgn@&DgTbh3BTp40lTp>?4n`>uJ$VV!c@R~~tXhBD>xhAfYrX1| zy}p;6rd}u$NOcI1*|6w`*rep>96gnbef9ZK$GKibPuhF#QOfn*i|1Xi{$UVxIbm9G z&jF9sZkNq}EWDlmT%uK@M`*I?g@ojf>((xPe5uN!;`M>!f=pgg!aGWM<&sL~Oi*CI zp!B5EK(l6JT=$H1`_%nTgkNOVtk+oE(WWt_qe3Isf!jZ)w9%CDq0I_2&1c{oKWJ=bF0dbU7E6)=3S= z`KL?$^piV%dUam^?Itl-x79rt`$Xr={kW-W-O2SoU4N8r+qc)Fm8XHP{5tn`+v`sh z{Lj8s5AbH^5J_6i$im3LumOmXgKqOqmaXiduq)uH1Bc-UUNJDu!4D40%_;(F+@Qep zk+ug>z0&3&>X@_*r%~0Z5U{b6xn<1cLA>1$Yj{i985oYrF))ZQAcHlN6J(TaL2A}b zoP5m{=!nHk3=F);N*I!P7#J#Y^ovU>b5e`-DspoIycwB9fCfP#dGY}n8OFzx@5;!5 q9Pk&&`8`=mRugRT^3Q^<54ac@{9+gwBv1?$pPVGC&1NeN5(EG;t;m=F delta 546 zcmbPaJ=vNkz?+#xgn@&DgMp)PBTp406G!3Z4n`>uJ$VV!c@R~~tXd!Ieb_*x?Z4N_ z+UiMs&p2}1HJBX>AGmzfQ#rovM$H5l>;HQ*=ZelL_q_MqX3n0g-&VB0VXl3#b|t5_ z#>opFtE(%3sKnYd0>K@bgj?Ut0bBuugzbfkUqv zTLNoyyxF4b5AQcxMxIE1A)Y03JSpaE%&m@tpYOgsyr<^g?3b^FJcH+6iK!A144uYe zQ@88N3I9)9cI~oz;}Lvm)0vl6>0b^=ESEl~7pL{Z*q(F$`D^CWS5DyD{P*wKBf95B z73W;NQ^OeG&CZcxJm(fGBLl+*AVvn}evM(l(qNg{MNm#!lvvF_Q=Jc0a7)EoEn5I4Z}$Ai{tQ)=rL>Q3k77 zH*xYcSD+&nGchpmA}e7?nY>U&24wht85zbWlkdpLfjEDFoIjH#Wi`RNmwy&?eZa-Q W;1|QdAc3M=VsfIaHk+L^NDu%&`o%5) diff --git a/src/main/java/ru/egspt/ReportControls.java b/src/main/java/ru/egspt/ReportControls.java index 72844db..e0ce3d9 100644 --- a/src/main/java/ru/egspt/ReportControls.java +++ b/src/main/java/ru/egspt/ReportControls.java @@ -1,12 +1,42 @@ package ru.egspt; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; + public class ReportControls { public static void getExcellReport(App app){ System.out.println("Инициировано событие getExcellReport ..."); - app.getReportPane().getReportTableModel().toExcell(); + //выбор пути, для создания отчета + app.getReportPane().setReportPathChooser(new JFileChooser()); + app.getReportPane().getReportPathChooser().setDialogTitle("Сохранение файла"); + app.getReportPane().getReportPathChooser().setFileSelectionMode(JFileChooser.FILES_ONLY); + //уведомление пользователя о результатах формирования файла + int result = app.getReportPane().getReportPathChooser().showSaveDialog(app.getReportPane().getReportPathChooser()); + if (result == JFileChooser.APPROVE_OPTION ){ + JOptionPane.showMessageDialog(app.getReportPane().getReportPathChooser(), + "Файл '" + app.getReportPane().getReportPathChooser().getSelectedFile() + + "' выбран"); + } + //создание отчета по указанному адресу + app.getReportPane().getReportTableModel().toExcell(app.getReportPane().getReportPathChooser().getSelectedFile()); + + } public static void implantData(App app){ System.out.println("Инициировано событие implantData ..."); + //выбор файла с данными для включения в отчет + app.getReportPane().setDataPathChooser(new JFileChooser()); + app.getReportPane().getDataPathChooser().setDialogTitle("Выбор файла ...."); + app.getReportPane().getDataPathChooser().setFileSelectionMode(JFileChooser.FILES_ONLY); + //уведомление пользователя о результатах формирования файла + int result = app.getReportPane().getReportPathChooser().showSaveDialog(app.getReportPane().getReportPathChooser()); + if (result == JFileChooser.APPROVE_OPTION ){ + JOptionPane.showMessageDialog(app.getReportPane().getReportPathChooser(), + "Файл '" + app.getReportPane().getReportPathChooser().getSelectedFile() + + "' выбран"); + } + //изменение модели данных в соответствии с данными файла-расширения + app.getReportPane().getReportTableModel().updateReport(app.getReportPane().getReportPathChooser().getSelectedFile()); } } diff --git a/src/main/java/ru/egspt/ReportPane.java b/src/main/java/ru/egspt/ReportPane.java index 8783a5b..5614286 100644 --- a/src/main/java/ru/egspt/ReportPane.java +++ b/src/main/java/ru/egspt/ReportPane.java @@ -130,4 +130,29 @@ public class ReportPane extends JPanel { i++; } } + /** + * @return the reportPathChooser + */ + public JFileChooser getReportPathChooser() { + return reportPathChooser; + } + /** + * @param reportPathChooser the reportPathChooser to set + */ + public void setReportPathChooser(JFileChooser reportPathChooser) { + this.reportPathChooser = reportPathChooser; + } + /** + * @return the dataPathChooser + */ + public JFileChooser getDataPathChooser() { + return dataPathChooser; + } + /** + * @param dataPathChooser the dataPathChooser to set + */ + public void setDataPathChooser(JFileChooser dataPathChooser) { + this.dataPathChooser = dataPathChooser; + } + } diff --git a/target/classes/ru/egspt/ReportControls.class b/target/classes/ru/egspt/ReportControls.class index 97de5586c1989949a3585be58430793692e85486..481c03b3b68507993e9298c9019936778bcdd049 100644 GIT binary patch literal 1944 zcmZ`)TUQ%Z6#h=3oiLpi2<1{+?6jgJR2VO{YJ(sRw5CGA22i{Y$uSw2%#4!>v`p-4y=5ut>^atf4#iVL`?KxfdJWKeb*F5xAHQ}nFNf5~)+&A~*n zMMBGwQt&dvkU(+QC~s3_f2Vh>lMq+b3cX|1~q&rLF%I_ zrjQn`Ff87h({KYfrIaNeo)_3iu5~&LlB76Ei4QXxZs9}fG1K$7lV=!j7mVz{l%!EM zrPNRz3bD9AX^raPPVE8dHsVo)T@+!L4n=Fo?-@llqKPl>XvkujAr`puKGE9%-o^!i zU&SX1KCbiBRLP17BXKHU0-tO60$-AZn=*?g ziYT%zWco~ZwA=*qYpg3UY3>|qfYv1qIS})dv79~8)M+$#R4Fm`I;cX#b*mG_IHJP& zyj-zq-mnaHZZD(8|ONr&S@#pqMJ$-mL%bsN!nA(VMU&Q*6#jF;O>ZUUyU%v5F=}V&|f0d2V(^d`Syjbvn=?8YWv@5;c$ zzzB4o@FoTUA+c=?5?b3Bw-~y6-49q~1m4SnSjX{Wkoq-$3n z&}T3J@;Dg`8Tf%B>_E0T)JRT{kw!ox5e9Jqr9g@~fJT4~5d)jT2{nZg7)&5LO#wq0 BHW>f_ diff --git a/target/classes/ru/egspt/ReportPane.class b/target/classes/ru/egspt/ReportPane.class index 8781a0449e112342cf58c20ba6b015cb9042efbf..fb1f3119fb70c1752e9b25dc0d0b3fff20be1522 100644 GIT binary patch delta 648 zcmZ{h%St0r5QgiIqytSzw;>Z1G;zk(bmAr6Zy6mmQAZ~WapBBDgkCgWNlQ9jHsacq z!ogMa6-1dC5Et_RK7{Db2XH-1oi->+2AWgFUw@tNRP|HO`G9)+_vQ}~_2b)>x)3^y ztlFhTd)q0N7Oc`*cFl2Iy9jDDllcv6*V<3Jd+UYO^!&{FmR+f4KoPfUSCjewrsNVR z%&?qQvR+Y9W`+5(w`x)R2#qOiFat=4a;OnWaUIIB&=o{l__UnTkHG*2L|#kO3}IO8 zYWL_9-*qE1suD03L<akI7Fb;v!ntt&uM8#mA}~^F8PEne(YS$9&HzGv`cl;$g|rRk@(b z3*|iWh5pnvTE$9zES>^S%pP7?6;G!q*T*uRhicF*CqfT;IYv1fVJ(AkeDSggWRb%( N*W^E#!B@;v!#{PRcIp5C delta 337 zcmZvXze>YU6vofj(geaaNe2}R#%LR>wHm9bt;YYUgOlRy;t*U)Qj!S1#|6Q`hbS)M z-~;#+f{T+NI*TWnh0FPVeCNCOocqxI>1eON&o4ye;bg3x>+(zY>oyit%!8(r8#la8 zN11yOj^ZQ>;wVevVJc9UXU0IWu_Ul8?-|#yuELe?Mzh?(hMX|puqr>zhVN+v^aN&M z849*cczkkiS75R5d^SMhG>XC`7+$4mn5sAeInp*AMMVIz7%h2My@dYwUHwpMrj|cQ zph;fcWi7E*T2GjhYR$TBz#(vk2mF(1jyYVS9#@6iL~ZJG6$MvNT&6Nwc?v6NvraK> Yve!i)+Xd}l5BoUaUjCUw9AiK;f4$i?G5`Po diff --git a/target/classes/ru/egspt/ReportTableModel.class b/target/classes/ru/egspt/ReportTableModel.class index d7f8954280de3f9d1c8866d992fa9d36a79325b9..b81eada0f5e0dea760cce7ad56023b059af418d5 100644 GIT binary patch delta 2824 zcmbVNYjjlA75=_?YPI zv-duGf8Rbou6(1)bNJee2LRm4)w?}a?ldBKbj{lO4fQ3>Z6&jsTSDap%UyWOoaZif zyiF9EClhkb?QTz?4?Y*(BjT2X+S@w99`xbwUYx=Q=0W!&_i3Cl@DCzi`uR>T&f=Uo z%Tw;YfPWeICy`@TC1$ynv~Bd_-?(V*^i;%M!hZ~0HqUwT{8w-<;q45Cr-xcvme;p* zgN9vbv` z;l>F?ORtwcCYV!wqtg4BAo+~k{5fUO+r#doOG_yE}_Xlf9f`WzQKiZb`}&yyec@)xM@a9J*dE!t+Tuod%~8X@h}UMW55!-lfPo zLiOuCtfI%t*KNuir%zHc{|As8^sGckYo?d8I9ui$L*d${P$)btOcaftV;)Z^jCgRG zbG)33V!|hdn)=SLFtDI&y|q%~<$Rn|`LrTwJT7pdmy5Vq$rwkS}&L4 zB4J3uT8zgfF86W;>WCD{bcW{E#sL_mbSbZKO`+z-CI#i#*t{lWCM8uf$y}UNsA}Jn zG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