Jump to content
Changes to the Jaspersoft community edition download ×

mtassinari

Members
  • Posts

    50
  • 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 mtassinari

  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
  15. Hi everybody =) I'm opening this thread to ask if there is an automated supported way to rotate images in jasper report. The problem is, I have an image saved on a database as blob, and the rendering works perfectly, but I'd like to have it rotated 90°. I cannot do it from the print servlet 'cause it is completely automated and I do not want to modify it just to handle this special case, and I cannot save a rotated copy of the image on the database due to the table size, so I was wondering if there is a way, like some options to specify in the report template, to have the image rotated. If such option is not present, would'nt it be a nice feature to add in a future release? =D Thanks in advace.
  16. This really seems to be a good solution, I'm gonna try it ASAP. But, I have a small problem: we use iReport to create our template files, but my knowledge of it is quite limited... How do you set an element style using iReport? /tools/fckeditor/editor/images/smiley/msn/embaressed_smile.gif
  17. Actually we do not use any .jrtx file in our application, we just have the .jrxml which are compiled on the fly and then filled with all the needed data, and I do not think we can modify the workflow of the application to introduce the style files... Isn't there a way to do it directly in the .jrxml file?
  18. Hi everybody I was wandering whether it was possible to set the background color of text elements (both the static labels and the text fields) using a report parameter instead of having to explicitly write the color value. IReport doesn't seem to accept a variable in that field. We are currently using jasperreports 3.7.6 with iReport 3.7.6
  19. well, for example the SQL exception should contain at least the error number and error message reported from MySQL. Anyway, I'll give it a look to see if I missed it, perhaps it is already there and I simply did not check the entire stack.
  20. Hi everybody I'm opening this thread to make a "feature request" if possible: I always find hard to understand my reports' problems when there is an exception thrown at compile time, especially when it comes to SQL errors. The usual message I get is "error executing statement for ***", and that alone isn't much help in identifying the cause of the problem. Wouldn't it be possible, in this specific case, to add the full SQL error message, and more in general to have more self-explaining excepion messages?
  21. Hi everybody, I'm opening this thread in order to try to resolve a very strange problem I'm having: one of the reports I've created causes sometime an error that reads "unable to get value for field 'id_user' of type 'java.lang.Integer'". Now, while it is true that "id_user" is not an integer (it is a varchar actually), I do not understand why this error appears considering that: 1) in the jrxml source (generated using iReport 3.7.3) there is absolutely NO field/parameter/variable/whatever named "id_user" and having type integer 2) in the associated query, the "id_user" field is NOT selected So the question is, why would the servlet, which compiles and fills the .jrxml source on-the-fly, complain for such error? Thanks to anybody who'll provide some insight.
  22. How did you solve the problem? As far as I know, "isBold" and "fontSize" where the proper attribute names! O.o also, I've noticed that using simple html like "<b>TEXT</b>" doesn't seems to work anymore, not in the preview nor in the actual printed report. I've tried to set the markup to both "styled" and "html", but if I remember correctly, the "styled" option used to include the html part... any help anyone? EDIT: I don't really know about "fontSize", but I'm SURE I've used "isBold" plenty of times before, together with the html tags... Post Edited by mtassinari at 06/16/2010 14:16
  23. Hi everybody :) I'm opening this post with the hope to receive some clarification on how multiple detail bands on a single report work. I've noticed that this feature has been introduced some time ago, but I found nothing on how they work or what their purpose is. Here is something I was asking myself: is it possible to assign a distinct SQL query to EACH detail band? if so, how? More generally speaking, as I said, I'd like to have some clarifications on the topic in general if possible.
  24. After quite a long time, I've tried doing as you suggested. Now, the database table contains a field named "image_content" which is a mediumblob which stores the image. The image itself was loaded in the filed via PHP, by reading the image file and saving a base64 encoding of it, so that when the image is retrieved, a base64 decode shows the image correctly. The problem is, if I set the image in the report to java.awt.Image type, I get this error when trying to print: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{image_content} Can somebody help me with this? EDIT: Solved! iReport recognized the database field as an Object, I just had to manually correct it to java.awt.Image. Perhaps it'd be useful to add "java.awt.Image" to the list of default types for a database field. Post Edited by mtassinari at 02/02/2010 12:02
×
×
  • Create New...