Jump to content
We've recently updated our Privacy Statement, available here ×

developer

Members
  • Posts

    19
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by developer

  1. Hi , All I want to print text field in BOLD depending on value that is passed from Java. Could anybody tell me how I can do that. Is it real? Thanks.
  2. Hi, I have the similar problem to described in http://jasperforge.org/projects/jasperreports/bugtracking/view.php?id=2834 I have an image in my subreport. I set an image heigh to 1 and a ScaleType to "RealSize". But when I generate my report the Image doesn't stretch. Could anybody tell me what is wrong? Thanks.
  3. Hi, I have the similar problem to described in http://jasperforge.org/projects/jasperreports/bugtracking/view.php?id=2834 I have an image in my subreport. I set an image heigh to 1 and a ScaleType to "RealSize". But when I generate my report the Image doesn't stretch. Could anybody tell me what is wrong? Thanks.
  4. developer

    Align

    Hi , All I have a report with a next structure: Label_1 : Value1 Label_2 : Value2 The task is : when we type very long value to the Value1-Field -> Lable2 and Value2 must positionate down. I use "frame" element for grouping Label_2 : Value2 - I set the positionType of Frame to Float , but they are not displayed. Can anyone help me? Thanks
  5. Hi, I attach the log file: I don't understand what libs I must to add. If I add all libs from jasper libs then in my web app under linux there are a bug described in attached file. If I don't add some libraries the then there are : Error retrive from bean... :blink: Big thanks [file name=login-518e2855ccf083cee982d4c9ce79f1e2.html size=8132]
  6. Can somebody tell me is there are some campatibility issue with jasper libs and other libs?After adding jasper libs my web app have been broken:(
  7. Hi All, I add jasper libs to my web App on Windows - everything works OK. But when I do the same steps on Linux there are some errors. What can be the reason of this strange behaviour and how to fix that? P.S.net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : tailNum Post edited by: developer, at: 2008/05/26 13:56
  8. Hi, I have next report: Code: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="PieChartDemoReport"> <field name="tailNum" class="java.lang.String" /> <field name="aircraftSerial" class="java.lang.Integer"/> <variable name="totalAircraft" class="java.lang.Integer" calculation="Sum" resetType="Group" resetGroup="modelGroup"> <variableExpression> <![CDATA[$F{aircraftSerial}]]> </variableExpression> <initialValueExpression> <![CDATA[new java.lang.Integer(0)]]> </initialValueExpression> </variable> <group name="modelGroup"> <groupExpression> <![CDATA[$F{tailNum}]]> </groupExpression> </group> <summary> <band height="700" isSplitAllowed="true" > <pie3DChart> <chart hyperlinkTarget="Self" > <reportElement x="120" y="0" width="400" height="400" key="element-1"/> <box></box> <chartLegend textColor="#000000" backgroundColor="#FFFFFF" > </chartLegend> </chart> <pieDataset> <dataset > </dataset> <keyExpression><![CDATA[$F{tailNum}]]></keyExpression> <valueExpression><![CDATA[$V{totalAircraft}]]></valueExpression> <sectionHyperlink > </sectionHyperlink> </pieDataset> <pie3DPlot > <plot /> </pie3DPlot> </pie3DChart> </band> </summary> </jasperReport> The filling Servlet is: Code:[code] public class MyServlet extends HttpServlet { private JRDataSource createReportDataSource() { JRBeanArrayDataSource dataSource; AircraftData[] reportRows = initializeBeanArray(); dataSource = new JRBeanArrayDataSource(reportRows); return dataSource; } private AircraftData[] initializeBeanArray() { AircraftData[] reportRows = new AircraftData[11]; reportRows[0] = new AircraftData("N1",10); reportRows[1] = new AircraftData("N1",10); reportRows[2] = new AircraftData("N1",10); reportRows[3] = new AircraftData("N1",10); reportRows[4] = new AircraftData("N1",1); reportRows[5] = new AircraftData("N1",1); reportRows[6] = new AircraftData("N1",1); reportRows[7] = new AircraftData("N2",1); reportRows[8] = new AircraftData("N2",1); reportRows[9] = new AircraftData("N2",1); reportRows[10] = new AircraftData("N2",1); return reportRows; } /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); try { JasperReport jasperReport = JasperCompileManager.compileReport(getServletConfig().getServletContext().getRealPath("/reports/test.jrxml"«»)); Map parameters = new HashMap(); JRDataSource dataSource = createReportDataSource(); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters, /*new JREmptyDataSource()*/dataSource); JRHtmlExporter exporter = new JRHtmlExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image="«»); request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint); exporter.exportReport(); } catch (JRException ex) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); ex.printStackTrace(printWriter); out.println(ex.toString()); out.println(ex.getMessage()); } } .... But I have : net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : tailNum Error retrieving field value from bean : tailNum :blink: Thanks P.S. Bean: Code:[code] public class AircraftData { public AircraftData(String tail, int serial) { setTailNum(tail); setAircraftSerial(serial); } public AircraftData() { } private String tailNum; private int aircraftSerial; public int getAircraftSerial() { return aircraftSerial; } public void setAircraftSerial(int aircraftSerial) { this.aircraftSerial = aircraftSerial; } public String getTailNum() { return tailNum; } public void setTailNum(String tailNum) { this.tailNum = tailNum; } } Post edited by: developer, at: 2008/05/25 12:42
  9. Hi All, I add to my web - app next libraries: Code: commons-collections-2.1.jar, commons-digester-1.7.jar, jasperreports-2.0.4.jar, jasperreports-2.0.4-applet.jar, jasperreports-2.0.4-javaflow.jar, jcommon-1.0.0.jar, jfreechart-1.0.0.jar, xalan.jar, xercesImpl.jar, xml-apis.jar. Compilation is OK. But when I run my project the next exception displays: Code:[code] net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: /opt/netbeans-5.5/enterprise3/apache-tomcat-5.5.17/bin/PieChartDemoReport_1211714423569_535946.java:4: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ /opt/netbeans-5.5/enterprise3/apache-tomcat-5.5.17/bin/PieChartDemoReport_1211714423569_535946.java:5: package net.sf.jasperreports.engine.fill does not exist import net.sf.jasperreports.engine.fill.*; ^ /opt/netbeans-5.5/enterprise3/apache-tomcat-5.5.17/bin/PieChartDemoReport_1211714423569_535946.java:18: cannot find symbol symbol: class JREvaluator public class PieChartDemoReport_1211714423569_535946 extends JREvaluator ^ /opt/netbeans-5.5/enterprise3/apache-tomcat-5.5.17/bin/PieChartDemoReport_1211714423569_535946.java:25: cannot find symbol symbol : class JRFillParameter location: class PieChartDemoReport_1211714423569_535946 private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null; ^ /opt/netbeans-5.5/enterprise3/apache-tomcat-5.5.17/bin/PieChartDemoReport_1211714423569_535946.java:26: cannot find symbol symbol : class JRFillParameter location: class PieChartDemoReport_1211714423569_535946 private JRFillParameter parameter_REPORT_CLASS_LOADER = null; How to fix this problem?May be I must to add some additional library? Big Thanks!
  10. Hi, thanks for response. I have a JR version 2.0.4 In Windows netbens version 5.0 everything works OK but on Linux(Debian) after adding libs my web app fails. I make reports with one JR 2.0.4(in my app I use libs of JR for creation and displaying) When I said about compatibility I mean compatibility with maybe jstl :blink: or other netbeans tomcat libs??? Is there some solution?May be in netbeans there are some specific way how to add libs to classpath :blink: or may be some lib from JR I need't to add??? Thanks! Post edited by: developer, at: 2008/05/16 16:39
  11. Hi All, after adding Jasper's lib my WebApp doesn't want compile. I attach the log file : Is there some compatibility issue may be? I use : netbeans,Tomcat, mysqlconnector,jstl libs. Thanks. [file name=login.html size=8132] Post edited by: developer, at: 2008/05/16 10:08
  12. Hi, a have the next report Code: <jasperReport name="PieChartDemoReport"> <field name="tailNum" class="java.lang.String" /> <field name="aircraftSerial" class="java.lang.Integer"/> <variable name="totalAircraft" class="java.lang.Integer" calculation="Count" resetType="Group" resetGroup="modelGroup"> <variableExpression> <![CDATA[$F{aircraftSerial}]]> </variableExpression> <initialValueExpression> <![CDATA[new java.lang.Integer(0)]]> </initialValueExpression> </variable> <group name="modelGroup"> <groupExpression> <![CDATA[$F{tailNum}]]> </groupExpression> </group> <summary> <band height="750"> <pieChart> <chart evaluationTime="Report"> <reportElement x="135" y="0" width="270" height="350" /> </chart> <pieDataset> <dataset incrementType="None" /> <keyExpression> <![CDATA[$F{tailNum}]]> </keyExpression> <valueExpression> <![CDATA[$V{totalAircraft}]]> </valueExpression> </pieDataset> <piePlot> <plot/> </piePlot> </pieChart> </band> </summary> </jasperReport> But in my browser insted one chart there several.When I fill a report the data is: tailNum="A" aircarftSerial=10 tailNum="A" aircarftSerial=1 tailNum="B" aircarftSerial=2 tailNum="A" aircarftSerial=20 But in chart it displays on 2 equals part.It seems that aircarftSerial doesn't calculated?? P.S. How to set aggregation functions on iReport? Thanks
  13. Hi , big THANKS I undertand my bug It's working :). Now Image successfuly displays in my browser but instead one image there are several charts and there no aggregation functions on chart.:blink: However Thanks!!! Post edited by: developer, at: 2008/05/10 07:19
  14. Ishannon , Thank You very much for response. I set classpath successfuly(set path to jar file instead C:).But iReport generate me the same report that I did manualy (I began to use iReport because i thought that in my manualy report was a bug).I have a simple Bean which contains String and int field.I want to grup by String field. Code: <jasperReport name="PieChartDemoReport"> <field name="tailNum" class="java.lang.String" /> <field name="aircraftSerial" class="java.lang.Integer"/> <variable name="totalAircraft" class="java.lang.Integer" calculation="Count" resetType="Group" resetGroup="modelGroup"> <variableExpression> <![CDATA[$F{aircraftSerial}]]> </variableExpression> <initialValueExpression> <![CDATA[new java.lang.Integer(0)]]> </initialValueExpression> </variable> <group name="modelGroup"> <groupExpression> <![CDATA[$F{tailNum}]]> </groupExpression> </group> <summary> <band height="750"> <pieChart> <chart evaluationTime="Report"> <reportElement x="135" y="0" width="270" height="350" /> </chart> <pieDataset> <dataset incrementType="None" /> <keyExpression> <![CDATA[$F{tailNum}]]> </keyExpression> <valueExpression> <![CDATA[$V{totalAircraft}]]> </valueExpression> </pieDataset> <piePlot> <plot/> </piePlot> </pieChart> </band> </summary> </jasperReport>As I understand the group field set in KeyExpression- right? But when I try to generate report from Servlet no data displayed but only missing images in my browser :( So I can't undestand is it's bug in my report?and how to set aggregation functions in iReport for charts - is it possible P.S. In my console app the same report show me the : Code:[code] net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : aircraft at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:127) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:100) at net.sf.jasperreports.engine.data.JRBeanArrayDataSource.getFieldValue(JRBeanArrayDataSource.java:90) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:814) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:778) Thank You very much for reading this long text and sorry for my English it's not my native language.
  15. Hi, Ishannon I am new in iReport and JasperReports. When I go to Data -> Report Query -> JavaBean DataSource the dialog shows me Class not fount exception.Check class path. In Options->CLASSPATH i set value for example C: but exception appear again. Could You help me?
  16. developer

    Charts

    I want to generate report with charts. Is it neccessary to use SQL in report for providing data or I can use JRBeanCollectionDataSource Can somebody give me simple sample how to generate Chart report from JRBeanCollectionDataSource. Thanks!
  17. Hi, I have the next report: Code: <jasperReport name="AircraftReport"> <field name="tailNum" class="java.lang.String" /> <field name="aircraftSerial" class="java.lang.String" /> <field name="aircraftModel" class="java.lang.String" /> <field name="engineModel" class="java.lang.String" /> <pageHeader> <band height="30"> <staticText> <reportElement x="0" y="0" width="69" height="24" /> <textElement verticalAlignment="Bottom" /> <text> <![CDATA[Tail Number: ]]> </text> </staticText> <staticText> <reportElement x="140" y="0" width="79" height="24" /> <text> <![CDATA[serial Number: ]]> </text> </staticText> <staticText> <reportElement x="280" y="0" width="69" height="24" /> <text> <![CDATA[Model: ]]> </text> </staticText> <staticText> <reportElement x="420" y="0" width="69" height="24" /> <text> <![CDATA[Engine: ]]> </text> </staticText> </band> </pageHeader> <detail> <band height="30"> <textField> <reportElement x="0" y="0" width="69" height="24" /> <textFieldExpression class="java.lang.String"> <![CDATA[$F{tailNum}]]> </textFieldExpression> </textField> <textField> <reportElement x="140" y="0" width="69" height="24" /> <textFieldExpression class="java.lang.String"> <![CDATA[$F{aircraftSerial}]]> </textFieldExpression> </textField> <textField> <reportElement x="280" y="0" width="69" height="24" /> <textFieldExpression class="java.lang.String"> <![CDATA[$F{aircraftModel}]]> </textFieldExpression> </textField> <textField> <reportElement x="420" y="0" width="69" height="24" /> <textFieldExpression class="java.lang.String"> <![CDATA[$F{engineModel}]]> </textFieldExpression> </textField> </band> </detail> </jasperReport> I generate this report from Servlet but on my Web browser text information displays with an empty images. How to remove this empty fields?
  18. Hi All, I am new in JasperReports and I need to generate reports from Servlets/JSP. In Console Application I use code: Code: try { JasperReport jasperReport = JasperCompileManager.compileReport(getServletConfig().getServletContext().getRealPath("/reports/test.jrxml"«»)); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource()); JasperExportManager.exportReportToPdfFile(jasperPrint, getServletConfig().getServletContext().getRealPath("/reports/my.pdf"«»)); } catch (JRException e) { e.printStackTrace(); } But when I copy this code to servlet the following exception shown: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209745155775_886062.java:4: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209745155775_886062.java:5: package net.sf.jasperreports.engine.fill does not exist import net.sf.jasperreports.engine.fill.*; What setting I must do for working properly? I see examples from DEMO and tried to run in but there are the same problems:( Can somebody help me: I use NetBeans 5.5 , Apache Tomcat 5.5.17 May be trouble is in wring setting??? Can somebody show me the simple example how to generate report from Servlet Step by Step THANKS VERY MUCH THAT YOU READ THIS MESSAGE AND MAY BE HELP ME
  19. Hi All, sorry for my english:) I have the next code in Servlet: ServletOutputStream servletOutputStream = response.getOutputStream(); InputStream reportStream = getServletConfig().getServletContext().getResourceAsStream("/reports/FirstReport.jrxml"); try { JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, new HashMap(), new JREmptyDataSource()); response.setContentType("application/pdf"); servletOutputStream.flush(); servletOutputStream.close(); } catch (JRException e) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); response.setContentType("text/plain"); response.getOutputStream().print(stringWriter.toString()); response.getOutputStream().print(e.getMessage()); } But when I execute this the exception is shown: net.sf.jasperreports.engine.JRException: Error loading object from InputStream at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:196) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:580) at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(JasperRunManager.java:368) at bu.grsu.test.STest.processRequest(STest.java:40) at bu.grsu.test.STest.doGet(STest.java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:753) Thanks to All who can help me on this question. P.S. May be there are some other ways how to generate report from Servlet? I use Netbeans 5.5, Apache Tomcat 5.5.17. After some changes in my code I have got the next exception: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209718587554_414918.java:4: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209718587554_414918.java:5: package net.sf.jasperreports.engine.fill does not exist import net.sf.jasperreports.engine.fill.*; ^ D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209718587554_414918.java:18: cannot find symbol symbol: class JREvaluator public class simple_1209718587554_414918 extends JREvaluator I put the appropriate libs to Tomcat But It does't work :( Can somebody give the working sample how to generate a simple emty report from Servlet with neccesarry setting in Netbeans and Tomcat Thanks very much!!! Post edited by: developer, at: 2008/05/02 09:09
×
×
  • Create New...