بتاريخ: 4 أغسطس 20178 سنة comment_288785 المفترض لا لكن في هذه الحالة نقوم بالمقارنة الكاملة بين المثالين لمعرفة الاختلاف المؤدي لهذه المشكلة تقديم بلاغ
بتاريخ: 6 أغسطس 20178 سنة كاتب الموضوع comment_288801 عملت المقارنة بين المثالين ده المثال الغير شغال وهذا ما يظهر فى ال log repPath= report1.jasper conn= weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@96 <oracle.adf.view> <DocumentRenderer> <_isVersionStringHidden> <The setting to enable version display will be ignored because the application is running in production mode.> مع العلم ده شغال من ال bean الخاص بالصفحة وهذا المثال الشغال وهذا ما يظهر فى ال log repPath= report1.jasper conn= weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@89 وده اللى شغال من ال class اللى فى مثال شرح ال jasper report تقديم بلاغ
بتاريخ: 6 أغسطس 20178 سنة كاتب الموضوع comment_288802 الحمد لله ظهر الخطأ هو كنت بأستخدم button وليس command buttun تقديم بلاغ
بتاريخ: 6 أغسطس 20178 سنة كاتب الموضوع comment_288828 هو ده الفرق الوحيد واشتغلت مجرد ما غيرت ال button الى command button فى نفس المثال اللى موجودد فى شرح المهندس احمد سعيد ذودت button عادية بس داخل ال class bean اللى فى المشروع ما اشتغلتش وفى الامثل اللى انشأتها غيرت ال button الى command button جميعها اشتغلت وانا مستغرب هل هناك فرق بينهما تقديم بلاغ
بتاريخ: 7 أغسطس 20178 سنة كاتب الموضوع comment_288831 انا اسف يا باشمهندس على الاطالة لكن الموضوع غريب لماذا لم تشتغل الا بعد تغيير ال button الى command button(jsf .html) انا شغال على jdeveloper 12c تقديم بلاغ
بتاريخ: 7 أغسطس 20178 سنة كاتب الموضوع comment_288853 لما اناديها من butt عادية لا تعمل لما اناديها من command button تشتغل package view; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.sql.Connection; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.naming.Context; import javax.naming.InitialContext; import javax.servlet.ServletContext; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.export.JRCsvExporter; import net.sf.jasperreports.engine.export.oasis.JROdtExporter; import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter; import net.sf.jasperreports.engine.export.ooxml.JRPptxExporter; import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter; import net.sf.jasperreports.engine.type.WhenNoDataTypeEnum; import net.sf.jasperreports.engine.util.JRLoader; import oracle.adf.model.BindingContext; import oracle.binding.BindingContainer; public class JasperClass { public JasperClass() { } public String report_action() { // Add event code here... try { runReport("report1.jasper", null); } catch (Exception e) { e.printStackTrace(); } return null; } public void runReport(String repPath, java.util.Map param) throws Exception { Connection conn = null; try { HttpServletResponse response = getResponse(); ServletOutputStream out = response.getOutputStream(); response.setHeader("Cache-Control", "max-age=0"); response.setContentType("application/pdf"); ServletContext context = getContext(); InputStream fs = context.getResourceAsStream("/Reports/" + repPath); //InputStream fs = context.getResourceAsStream(repPath); JasperReport template = (JasperReport)JRLoader.loadObject(fs); // template.setWhenNoDataType(WhenNoDataTypeEnum.NO_DATA_SECTION); template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL); conn = getConnection(); JasperPrint print = JasperFillManager.fillReport(template, param, conn); ByteArrayOutputStream baos = new ByteArrayOutputStream(); JasperExportManager.exportReportToPdfStream(print, baos); System.out.println("repPath= "+repPath); System.out.println("conn= "+conn); out.write(baos.toByteArray()); out.flush(); out.close(); FacesContext.getCurrentInstance().responseComplete(); } catch (Exception jex) { jex.printStackTrace(); } finally { close(conn); } } public Connection getDataSourceConnection(String dataSourceName) throws Exception { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(dataSourceName); return ds.getConnection(); } private Connection getConnection() throws Exception { return getDataSourceConnection("java:comp/env/jdbc/TestJasper_ConnDS"); } public ServletContext getContext() { return (ServletContext)getFacesContext().getExternalContext().getContext(); } public HttpServletResponse getResponse() { return (HttpServletResponse)getFacesContext().getExternalContext().getResponse(); } public static FacesContext getFacesContext() { return FacesContext.getCurrentInstance(); } public BindingContainer getBindings() { return BindingContext.getCurrent().getCurrentBindingsEntry(); } public void close(Connection con) { if (con != null) { try { con.close(); } catch (Exception e) { e.printStackTrace(); } } } تقديم بلاغ
بتاريخ: 7 أغسطس 20178 سنة كاتب الموضوع comment_288857 public String report_action() { // Add event code here... try { runReport("report1.jasper", null); } catch (Exception e) { e.printStackTrace(); } return null; } public void runReport(String repPath, java.util.Map param) throws Exception { Connection conn = null; try { HttpServletResponse response = getResponse(); ServletOutputStream out = response.getOutputStream(); response.setHeader("Cache-Control", "max-age=0"); response.setContentType("application/pdf"); ServletContext context = getContext(); InputStream fs = context.getResourceAsStream("/Reports/" + repPath); //InputStream fs = context.getResourceAsStream(repPath); JasperReport template = (JasperReport)JRLoader.loadObject(fs); // template.setWhenNoDataType(WhenNoDataTypeEnum.NO_DATA_SECTION); template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL); conn = getConnection(); JasperPrint print = JasperFillManager.fillReport(template, param, conn); ByteArrayOutputStream baos = new ByteArrayOutputStream(); JasperExportManager.exportReportToPdfStream(print, baos); System.out.println("repPath= "+repPath); System.out.println("conn= "+conn); out.write(baos.toByteArray()); out.flush(); out.close(); FacesContext.getCurrentInstance().responseComplete(); } catch (Exception jex) { jex.printStackTrace(); } finally { close(conn); } } public Connection getDataSourceConnection(String dataSourceName) throws Exception { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(dataSourceName); return ds.getConnection(); } private Connection getConnection() throws Exception { return getDataSourceConnection("java:comp/env/jdbc/TestJasper_ConnDS"); } public ServletContext getContext() { return (ServletContext)getFacesContext().getExternalContext().getContext(); } public HttpServletResponse getResponse() { return (HttpServletResponse)getFacesContext().getExternalContext().getResponse(); } public static FacesContext getFacesContext() { return FacesContext.getCurrentInstance(); } public BindingContainer getBindings() { return BindingContext.getCurrent().getCurrentBindingsEntry(); } public void close(Connection con) { if (con != null) { try { con.close(); } catch (Exception e) { e.printStackTrace(); } } public String report_action() { // Add event code here... try { runReport("report1.jasper", null); } catch (Exception e) { e.printStackTrace(); } return null; } public void runReport(String repPath, java.util.Map param) throws Exception { Connection conn = null; try { HttpServletResponse response = getResponse(); ServletOutputStream out = response.getOutputStream(); response.setHeader("Cache-Control", "max-age=0"); response.setContentType("application/pdf"); ServletContext context = getContext(); InputStream fs = context.getResourceAsStream("/Reports/" + repPath); //InputStream fs = context.getResourceAsStream(repPath); JasperReport template = (JasperReport)JRLoader.loadObject(fs); // template.setWhenNoDataType(WhenNoDataTypeEnum.NO_DATA_SECTION); template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL); conn = getConnection(); JasperPrint print = JasperFillManager.fillReport(template, param, conn); ByteArrayOutputStream baos = new ByteArrayOutputStream(); JasperExportManager.exportReportToPdfStream(print, baos); System.out.println("repPath= "+repPath); System.out.println("conn= "+conn); out.write(baos.toByteArray()); out.flush(); out.close(); FacesContext.getCurrentInstance().responseComplete(); } catch (Exception jex) { jex.printStackTrace(); } finally { close(conn); } } public Connection getDataSourceConnection(String dataSourceName) throws Exception { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(dataSourceName); return ds.getConnection(); } private Connection getConnection() throws Exception { return getDataSourceConnection("java:comp/env/jdbc/TestJasper_ConnDS"); } public ServletContext getContext() { return (ServletContext)getFacesContext().getExternalContext().getContext(); } public HttpServletResponse getResponse() { return (HttpServletResponse)getFacesContext().getExternalContext().getResponse(); } public static FacesContext getFacesContext() { return FacesContext.getCurrentInstance(); } public BindingContainer getBindings() { return BindingContext.getCurrent().getCurrentBindingsEntry(); } public void close(Connection con) { if (con != null) { try { con.close(); } catch (Exception e) { e.printStackTrace(); } } تقديم بلاغ
بتاريخ: 7 أغسطس 20178 سنة كاتب الموضوع comment_288867 ده زرار ال button العادية التقرير لا يعمل <af:button text="تقرير" id="b1" binding="#{backingBeanScope.backing_TestJasperRep.b1}" action="#{JasperCalssRep.report_action}"/> ده زرار ال command button التقرير يشتغل <h:commandButton value="commandButton1" id="cb1" binding="#{backingBeanScope.backing_TestJasperRep.cb1}" action="#{JasperCalssRep.report_action}"/> تقديم بلاغ
بتاريخ: 8 أغسطس 20178 سنة كاتب الموضوع comment_288899 قمت بالتعديل على هذا النحو <af:button text="تقرير" id="b1" action="#{JasperCalssRep.report_action}"/> ولكن لم تشتغل تقديم بلاغ
بتاريخ: 9 أغسطس 20178 سنة comment_288962 تحتاج إلى تدقيق كامل لمعرفة السبب فقد يكون هناك شئ أخر تقديم بلاغ
بتاريخ: 11 سبتمبر 20178 سنة كاتب الموضوع comment_289895 لما عملت كود مناداة تقرير ال jasper من خلال صفحة فى مشروع التقرير لا يعمل هذا هو كود الزرار public String report_action() { System.out.println("runreport_repfrst"); try { //runReport("Att_Dep_rep.jasper",m); System.out.println("runreport_rep"); runReport("Att_Dep_rep.jasper",null); } catch (Exception e) { e.printStackTrace(); } System.out.println("runreport_repLst"); return null; } وهذا ما يظهر فى ال log runreport_repfrst runreport_rep connection= weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@a5 repPath= Att_Dep_rep.jasper conn= weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@a5 runreport_repLst لا يعطى اية اخطاء تقديم بلاغ
بتاريخ: 11 سبتمبر 20178 سنة كاتب الموضوع comment_289916 اختارت صفحة اخرى فى المشروع ووضعت ال command buuton اللى بنادى من خلالها على التقرير ووضعت الكود فى ال page bean الخاصة بهذه الصفحة واشتغلت لكن فى الصفحة اللى محتاج انى اشغل التقرير من خلالها التقرير لا يظهر تقديم بلاغ
بتاريخ: 12 سبتمبر 20178 سنة كاتب الموضوع comment_289927 الشاشة المطلوبة كود الزر <h:commandButton value="commandButton1" id="cb1" binding="#{backingBeanScope.backing_Emp_ِAtt_Dep2.cb1}" action="#{backingBeanScope.backing_Emp_ِAtt_Dep2.report_action}"/> الشاشة اللى بتشغل التقرير <h:commandButton value="commandButton1" id="cb1" binding="#{backingBeanScope.backing_ATT_DEP_ADJ.cb1}" action="#{backingBeanScope.backing_ATT_DEP_ADJ.report_action}"/> تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.