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

mwatkinson

Members
  • Posts

    13
  • 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 mwatkinson

  1. Just a minor addition, I recently had a problem with conditional statements and subreports. i recommend this minor change to augarte's suggestion: (($F{Field1}==new Integer(1).intValue() && $F{Field2}!=new Integer(0).intValue()) ? Boolean.TRUE : Boolean.FALSE) It appears that at least in version 4.1.3 failure to explicitly define a integer value as such can in some circusmstances result in it being treated as a string value, thereby causing a class cast exception at runtime.
  2. I finally got to the bottom of this issue. In 4.0.1 the following conditional statement was perfectly valid: $V{REPORT_COUNT%2 ==0 However if the same report is compiled in Ireports 4.1.3 then the 2 and 0 are interpreted as "2" and "0" string values - this does not appear to be intended behaviour at all. Furtheremore the problem only occurs when there are MULTIPLE SUBREPORTS whcih makes it all the stranger. The correction however is simple. In each subreport all numbers must be EXPLICITLY cast as numerics to avoid classcast expceptions; new Boolean($V{REPORT_COUNT}.intValue() % new Integer(2).intValue() ==new Integer(0).intValue()) That line fixed the issue and allowed me to generate the report and keep the conditional formatting (grid row colour alternation) Has this bug been corrected in more recent versions of Ireports?
  3. Ok, so this is down to the conditional formatting used to alternativly colour rows greay/white in a report. Without it all rows are white, reducing report readability. The report generates fine when there is ONE subreport with alternate row coliuring, but as soon as tehre rae two it gets the error in my original post. I even tried the following: new Boolean($V{REPORT_COUNT}.intValue() % 2 == 0) How can I successfully add alternate row coloring in IReports 4.1.3 to multiple subreports without encountering this error?
  4. Ok, I was finally able to get the report running but only by removing the following conditional formatting on the Row Style as pictured here (imageshack link): http://imageshack.us/photo/my-images/96/capturehej.jpg The same formatting was on BOTH subreports, so somehow they must be interfering with one another. Other than removing this conditional formatting however I dont know how to get the report running. Does anyone have an idea how I can correct the problem? Post Edited by mwatkinson at 01/26/2012 20:46 Post Edited by mwatkinson at 01/26/2012 20:47 Post Edited by mwatkinson at 01/26/2012 20:48
  5. Below is the method where this error is occuring, does anyone know what this method does? It appears to be evaluating conditional styles, however I am not using any conditional styles in my report so Im not sure why I would get an error here? Any ideas? specifically on the line: Boolean expressionValue = (Boolean) expressionEvaluator.evaluate( conditionalStyle.getConditionExpression(), evaluation ); full method: protected boolean buildConsolidatedStyle(JRStyle style, byte evaluation, StringBuffer code, List<JRStyle> condStylesToApply) throws JRException { boolean anyTrue = false; JRConditionalStyle[] conditionalStyles = style.getConditionalStyles(); if (conditionalStyles != null && conditionalStyles.length > 0) { for (int j = 0; j < conditionalStyles.length; j++) { JRConditionalStyle conditionalStyle = conditionalStyles[j]; Boolean expressionValue = (Boolean) expressionEvaluator.evaluate( conditionalStyle.getConditionExpression(), evaluation ); boolean condition; if (expressionValue == null) { condition = false; } else { condition = expressionValue.booleanValue(); } code.append(condition ? '1' : '0'); anyTrue = anyTrue | condition; if (condition) { condStylesToApply.add(conditionalStyle); } } } condStylesToApply.add(style); if (style.getStyle() != null) { anyTrue = anyTrue | buildConsolidatedStyle(style.getStyle(), evaluation, code, condStylesToApply); } return anyTrue; }
  6. I would need to see your report XML (in the designer click the XML tab between designer and preview) to better understand the issue. Is there an error occuring at all in the IReport console from the iReport output tab?
  7. I went back to an old report recently to make some changes. If I use the original compiled (using 4.0.1) version (which i fortunately had backed up) then the report executes successfully, no error. If I recompile the original and unchanged report using 4.1.3 then the report will no longer run and gets the following exception: Error filling print... java.lang.String cannot be cast to java.lang.Boolean java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at net.sf.jasperreports.engine.fill.JRFillElementContainer.buildConsolidatedStyle(JRFillElementContainer.java:766) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyle(JRFillElementContainer.java:728) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyles(JRFillElementContainer.java:716) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:472) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2021) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:265) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:640) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205) at java.lang.Thread.run(Thread.java:619) The report in question consists of one master report (with a title header and a page count footer) and two child subreports. Here is where things get tricky. Both subreports execute just fine for the same input values alone. The error only occurs when I compile the completed report containing both subreports. Furthermore, if I delete the first subreport from the master report then recompile, the report executes successfully. Likewise if I readd the first subreport and delete the second, the report executes successfully. I only get this error when BOTH subreports exist on a single master report which is compiled under 4.1.3 and the entire report is executed together. if I run the master report with either of the two subreprots included it executes successfully. This seems very counter intuitive to me, if one of the subreports has an error then the master report should not execute successfully when that report is the only one being run, but alas this is not so. Im not sure where else to go with this, and Im out of troubleshooting ideas: any suggestions on where to look for the cause?
  8. The problem with the following statement: ( $F{MaintOptionDesc}.split(";")[0] == null ? "BLANK" : "NOT BLANK" ) when MaintOptionDesc = ";;;;;" is that there are no values to return and the array from the split operation is of size 0. Since there is no check for this error, you recieve a java exception when it attempts to execute with a 'blank' input. For this to work when input is blank you will need an additional check: ( $F{MaintOptionDesc}.split(";").size() == 0 ? "BLANK" : "NOT BLANK" ) Once you have that you can extend it to get each of your values: ( $F{MaintOptionDesc}.split(";").size() > 0 ? "BLANK" : $F{MaintOptionDesc}.split(";")[0] ) ( $F{MaintOptionDesc}.split(";").size() > 1 ? "BLANK" : $F{MaintOptionDesc}.split(";")[1] ) ... ( $F{MaintOptionDesc}.split(";").size() > 4 ? "BLANK" : $F{MaintOptionDesc}.split(";")[4] ) I think this will give you want you want.
  9. I discovered a work around for the pagination bug - I set the page height large enough to fit two additional detail lines (an extra 22 pixels) and this prevented the report from placing the last two lines of the report on a new page even though there was sufficient room on the first page. At this point I would simply like to know if the bug can be corrected so that work arounds of this nature are no longer required. [edit - fixed a couple of typos] Post Edited by mwatkinson at 09/22/2011 18:52
  10. understand from reading on the forums that it is not possible to use different pagination in a subreport to its 'master' report. As such if a master report is set to ignore pagination then all subreports also ignore pagination and vice versa. This however causes me some problems because Ireports pagination does not work for the report I am working on. It is necesarry to have two detail sections per page containing the same data. The only way to achieve this was with subreports. Unfortunately to the best of my knowlege it is not possible to have subreprots where the first page is page 1 of each subreport, page 2 is page 2 of each and so forth. Therefore i have had to put together the following report structure: Master report subreport - page 1 subreport first half page 1 - exactly 1/2 a page in size subreport second half page 1 - exactly 1/2 a page in size subreport - page 2 subreport first half page 2 - exactly 1/2 a page in size subreport second half page 2 - exactly 1/2 a page in size subreport - page 3 subreport first half page 3 - exactly 1/2 a page in size subreport second half page 3 - exactly 1/2 a page in size etc... I have a seperate program which builds the jrxml with the appropriate number of subreports to create the correct number of pages, and simply adds aditional page subreports to the jrxml as required based ona preliminary SQL query to determin the page count. I can generate each half page perfectly, and each whole page also generates correctly with paginations set to ignore. However if pagination is enabled due to some display when sections I end up with an extra page with blank detail lines IE: Master report subreport - page 1 subreport first half page 1 - exactly 1/2 a page in size subreport second half page 1 - exactly 1/2 a page in size Page 1.5 blank defail lines overflow from page 1 second half subreport - page 2 subreport first half page 2 - exactly 1/2 a page in size subreport second half page 2 - exactly 1/2 a page in size Page 2.5 blank defail lines overflow from page 2 second half subreport - page 3 subreport first half page 3 - exactly 1/2 a page in size subreport second half page 3 - exactly 1/2 a page in size Page 3.5 blank defail lines overflow from page 2 second half etc... And with pagination set to ignore the report generates correctly, but is all on a single page. I need some way to have the individual pages generate correcty IE without pagination and then have the final report use pagination so that the report is correctly paged. Additionally there appears to be a bug in the pagination, whereby a detail line is forced onto the next page even if it can fit if it has 'print if' componants which are not being printed. I.E. I have a barcode which appears on some of my detail lines which causes them to take up 3 lines, however the last 2 lines are pushed onto a new page even when the barcode is not displayed. Any ideas how I can get thsi report to work given that it is not possible to have pagination on in the master report and off in the subreports?
  11. We would up using ghostscript to convert to PCL for printing purposes. Howver its good to hear that the next release will correct this bug.
  12. Im using 4.0.1 it still is an issue, I do not believe it has been corrected yet, can anyone else confirm?
  13. My apologies for necroposting, please let me know if I need to create a new thread for this. Has this bug been corrected? I am encountering the same issue and under UNIX or printer is rejecting the PDFs containing my Ireports. I have replaced the default font with Times New Roman, exported to a jar and replaced the default Helvetica by creating a default style using Times New Roman. Helvetica is still appearing in the PDF somehow and as a result I'm left unable to print any generated reports. Details of my Ireports install: Product Version: Jaspersoft iReport Designer 4.0.1 Java: 1.6.0_17; Java HotSpot Client VM 14.3-b01 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (ireport) Userdir: C:Usersmwatkins.ireport4.0.1 Post Edited by mwatkinson at 07/15/2011 19:10
×
×
  • Create New...