Jump to content
Changes to the Jaspersoft community edition download ×

mtassinari

Members
  • Posts

    50
  • Joined

  • Last visited

mtassinari's Achievements

  1. Hi everybody, I am facing a rather serious problem in some of our report: when the Java Servlet tries to compile the template and fill it with data, it throws a net.sf.jasperreports.engine.JRException with no useful message attached. The "guilty code" is the follwing: protected byte[] export(JasperPrint jasperPrint, JRExporter exporter) throws JRException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.exportReport(); return baos.toByteArray(); } and the exception is thrown when the execution reaches exporter.exportReport(); Any clue on what might actually be the cause? We are currently running JasperReport 5.1 on a Tomcat 7 + JDK 7 server. EDIT: here is the full stack trace, nothing useful though, I've checked all relevant code and all works well for other templates. net.sf.jasperreports.engine.JRException at com.aspose.words.jasperreports.AWAbstractExporter.exportReport(Unknown Source) at com.agews.suite626.servlet.old.Servlet.export(Servlet.java:192) at com.agews.suite626.servlet.old.Servlet.compile(Servlet.java:737) at com.agews.suite626.servlet.old.SingleReportOpzional.compile(SingleReportOpzional.java:146) at com.agews.suite626.servlet.old.SingleReportOpzional.process(SingleReportOpzional.java:46) at com.agews.suite626.servlet.old.Servlet.doPost(Servlet.java:155) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)
  2. Hi, I'm not sure if the title is worded properly, sorry for my english. I'm trying to use JasperServer OLAP functionality, to see if it can be integrated in our web application, and I am facing the following problem: our software, among other things, manages "tasks" (things to be done) which can be linked to "organization unit" or UO; a task can belong to zero or more UOs. Also, UOs form a tree which descends from a static root, the database keeps parent-child relationship. Considering the above, how should my cube be modeled, if a fact belongs to more than one UO? I thought about two possibilities: save a single row in the facts table, in which I save the UOs ids as a comma separated string: but, in this case, how do I express the fact that there isn't really a join field but it should perform a FIND_IN_SET() insted?save a row for each UO the task belongs to: but, in this case, wouldn't it count the task multiple times when computing the total, and also summing the task's cost multiple times?Here is my tentative Dimension definition: <Dimension foreignKey="uo_ids" name="Unità Organizzative"> <Hierarchy hasAll="true" allMemberName="Tutte le Unità Organizzative" primaryKey="uo_id"> <Table name="dim_uo"/> <Level name="Unità Organizzativa" column="uo_id" nameColumn="uo" parentColumn="parent_id" type="String" uniqueMembers="false"/> </Hierarchy></Dimension> How can I express that, instead of trying to match directly uo_id = uo_ids, it should perform FIND_IN_SET(uo_id, uo_ids)?
  3. After some tinkering, I've found that the problem was in the creation of an HashSet<String>, using a simple HashSet instead solved the problem.
  4. Hi everybody, I'm having a problem when exporting a report which has a quite complex expression in it. This reports reads a field named "fase_lavorativa" from the database, this field contains a text which is composed of a sequence of names, possibly repeated, separated by the string "n-----n". I am now trying to print the content of that field with the original separator replaced by ", " and with all duplicates removed, and I have come up with this expression: new HashSet<String>(Arrays.asList($F{fase_lavorativa}.split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", "") This should produce a string as I want it, however I get this error: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Syntax error on token "<", ( expected value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 2. Syntax error, insert ")" to complete Expression value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 3. Syntax error on token "<", ( expected value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getOldValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 4. Syntax error, insert ")" to complete Expression value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getOldValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 5. Syntax error on token "<", ( expected value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 6. Syntax error, insert ")" to complete Expression value = new HashSet(Arrays.asList(((java.lang.String)field_fase_lavorativa.getValue()).split("n-----n"))).toString().replaceAll("^\[", "").replaceAll("\]$", ""); //$JR_EXPR_ID=10$ ^ 6 errors However the iReport designer, which I used to create the report, does not display any syntax problem in the expression. Could you please help me?
  5. No one can help me with this issue? Am I doing something wrong during compilation, perhaps?
  6. That was it, I was passing a string to a subreport that was expecting an integer.
  7. I'm having an issue trying to upgrade from version 4.5.1 to 4.7.0: whenever I replace the old library with the new one, and I try to recompile our tomcat servlets which use the jasperreports functionality, I get an error saying that "class version is 50 but should be 49" I'm compiling using JDK 5, is jasperreports 4.7.0 still compatible with that JDK? Or what could be the problem? Restoring the old 4.5.1 version solves the problem, but I'd like to try to upgrade.
  8. I'm having an issue determining what is causing this problem: when I compile a specific report in our webapp, I get this error: java.lang.ClassCastException: java.lang.String also, by reading the stack trace, this seems to be caused by net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter() in JRJdbcQueryExecuter.java at line 469 but I really do not understand what is wrong here nor how to debug this error. Could you please help me?
  9. Hi everybody, I'm opening this thread to ask for some help in printing a particular report created using JasperReports. This report needs to print a tree-like structure, which has no fixed deepness, so I created it as a report which recursively calls itself changing only the father node ID. The problem is, when I try to compile/execute the report, I get an error saying java.lang.OutOfMemoryError: unable to create new native thread I'm not sure this is actually caused by JasperReports, what I've done was monitoring the memory usage, but it NEVER hit the maximum java heap size, which is set to 1.5 GB, in fact it blocked at about 210 MB. Any ideas on how to solve this? Thanks in advance. Post Edited by mtassinari at 05/21/2012 09:00
  10. Hi everybody, I've just encountered this problem: while trying to compile a report I'm getting this error javax.servlet.ServletException: net.sf.jasperreports.engine.JRException: Unable to get value for field 'data_ultima_revisione' of class 'java.sql.Date' The strange thing is that nowhere in my report there is a field named "data_ultima_revisione", nor is it present in a query. Could the problem happen if I have a "SELECT *" in a query, and the field data_ultima_revisione is declared as "date" on the database but has an invalid value? Even if the field is not list in the report fields list? Thanks in advance for your help.
  11. I will try that, but I'm wondering, why if I set the field type to integer for an unsigned tinyint on the database, I get that wrong result? Shouldn't the integer type go up to about 2^31? Anyway, for now I have solved setting a data type of String for those fields that were giving the error. Post Edited by mtassinari at 08/05/2011 13:38
  12. I just updated to the latest version, but still I can't get my unsigned tinyint fields printed correctly, jasperReports still reads them as signed. Also, the data type declared in the report is java.lang.Integer, so it should have a range much wider than -128~127 or 0~255... Can somebody help me? As I said, the database structure itself is correct, so it cannot and will not be changed.
  13. I'm not sure that I have understood what you suggest: as I said, the fields on the database are already properly defined as TINYINT UNSIGNED, as stated in my first post... Are you suggesting to change the query, somehow, or to change the database structure? 'Cause the structure is already correct in my opinion... So I would say this is a JasperReports' bug, if it cannot read the data correctly.
  14. Hi everybody, I'm facing a very strange problem while trying to pull some data from our database to a report for printing. This database (MySQL 5.1.42 on Windows 7) contains some medical data, like the height of a person in centimeters, which is stored as a tinyint unsigned. I've created a report using iReport, which correctly recognize the field as Integer, but when the report gets printed I get a wrong result, in fact the value on the database il 165 and the value printed is -91. I've checked the value on the DB, and it is correct, so it seems to be JasperReports which prints it wrong. I've also noticed that if I manually set the field as String, it is printed correctly. What could be causing the problem? If possible, I'd like to preserve the correct field type in all the report... Post Edited by mtassinari at 05/26/2011 09:08
×
×
  • Create New...