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

chgsd

Members
  • Posts

    15
  • Joined

  • Last visited

chgsd's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. When you say "item" what do you mean. The textField will not be printed with the block I gave to you. If you mean some parent element you need to use that same printWhenExpression for the given "item". For example if you do not want the detail band printed when that condition is met, put the printWhenExpression in the detail band. Does that make more sense? Cheers, CHgsd
  2. The problem lies not in what I gave you, but what you already had. You are casting that variable as a string, when it is not. Please change the class="java.lang.String" in the block below to something more appropriate, most likely java.math.BigDecimal in your case. I suspect that will solve your problem. Cheers, CHgsd Code: <variable name="STK_RTOT" class="java.lang.String" resetType="Group" incrementType="Group" incrementGroup="SOHNUM_0" resetGroup="ITMREF_0" calculation="Sum"> <variableExpression><![CDATA[$F{TOTSTK} - $V{STK_CNT}]]></variableExpression> <initialValueExpression><![CDATA[0]]></initialValueExpression> </variable>
  3. I am including below the relevant portion of your jrxml file. This should do what you want by only printing the textField if $V{STK_RTOT} is less than 0. If it evaluates to 0 or greater, the textfield should be absent. Code: <textField> <reportElement x="610" y="1" width="96" height="18"> <printWhenExpression><![CDATA[$V{STK_RTOT}<0]]></printWhenExpression> </reportElement> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$V{STK_RTOT}]]></textFieldExpression> </textField>
  4. If it can wait a few hours I can write the block of code for you, having the full report wouldn't hurt, but just the code for the element in question and perhaps surrounding elements would suffice. I can get to this in probably 4-6hours.
  5. What I was recommending was actually bypassing the printWhenExpression. Please review the code below and see if it works. There isn't anything wrong with printWhenExpression, but because of your mentioning your beginning with this, I meant to give you a string to replace your existing string with. printWhenExpression needs to return evaluate to true/false, and is like a switch that enables printing or not printing. What I gave to you always prints, just it prints nothing if the result is 0 or greater. I hope this helps. Cheers, CHgsd Code: <variable name="STK_RTOT" class="java.lang.String" resetType="Group" incrementType="Group" incrementGroup="SOHNUM_0" resetGroup="ITMREF_0" calculation="Sum"> <variableExpression><![CDATA[($F{TOTSTK} - $V{STK_CNT} < 0)?$F{TOTSTK} - $V{STK_CNT}:""]]></variableExpression> <initialValueExpression><![CDATA[0]]></initialValueExpression> </variable>
  6. chgsd

    jr:Table

    Alright, I apologize again everyone, but I was being pretty daft. I had forgotten that I had installed libjasperreports-java from the ubuntu repos in addition to using the jars from iReport. The repos had an older version of JR and it was being used in lieu of the iReport ones. Uninstalling the libjasperreports-java package, and thus forcing the other jars led to expected behavior. I am going to leave my previous post not merely for public shaming but also in case it proves educational for someone making the same daft mistakes I just did. Cheers, CHgsd Post Scriptum: I am actually surprised that the conflicting versions didn't cause more noticeable weirdness than they did.
  7. I apologize for crossposting, but there is another thread on this subject here: http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=77027 It recommends using the .jar's from iReport, which I have done (iReport 3.7.6) but I still receive this error. I have replied in the above linked thread with the exact error I am receiving and details about my setup. Could those of you who participated in this thread provide your recommendations or suggestions in that other one? Thank you! CHgsd
  8. chgsd

    jr:Table

    I apologize for resurrecting this thread but I appear to be having the same problem. I am using the contents of iReport-3.7.6/ireport/modules/ext/*.* And a report designed in iReport 3.7.6 containing a table component. The error I get is the following: ERROR generating Report: [[o:JRException]:"net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'jr:table'. One of '{"http://jasperreports.sourceforge.net/jasperreports":component}' is expected." at: I would happily provide any additional requested information that may help lead to a solution for this problem, but in the interest of not flooding this post I will limit it to a summary of my situation: jrxml file generated by iReport 3.7.6 jasper being called via php-java-bridge using the .jar's from iReport-3.7.6/ireport/modules/ext/ Setup in a similar manner to that discussed in this old post: Bullet proof jasper reports and php I will also add that so far everything has worked brilliantly as long as a table component is not present. Cheers, CHgsd
  9. I would like to pull the parameters from a given jrxml to present them to be filled out in a web based form. I saw code to do this a few days ago and failed to bookmark it. Some extensive googling has failed to retrieve it and I have had no success finding it in my browsing history either, it may have been on a different machine. Could someone point me to what is needed to read the required parameters of a jrxml report so that they can be presented to someone to then be filled out. I briefly looked over the API but not terribly familiar with it nothing jumped out at me. If I can't figure it out I can write something to go through the XML to achieve this purpose but I distinctly remember seeing a code example of builtin functionality for this, I just am having zero luck finding it! Thanks for any and all help! Cheers, CHgsd
  10. If I understood you correctly, you want to do something like what I have put in the code below. It should print the number if less than 0, otherwise print "" It uses the short if this?then do this:else do this syntax. I hope that helps. Code:($F{TOTSTK} - $V{STK_CNT} < 0)?$F{TOTSTK} - $V{STK_CNT}:""
  11. I believe at present grouping and sorting is built-in. I am using SQL to achieve ORDERing and iReport is handling grouping. Automatic styling is supported. If you create your own you can apply them to anything or use one of the many builtin report/table styles. Hierarchical Grouping I also do not understand but I suspect it is handled by your first question. Regarding your SVG question, there is a non-obvious solution if you are still attempting to do this. I updated an existing thread with the solution: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=12298 However I am including the sample code here as well. Good luck! Cheers, CHgsd Code:<image hAlign="Center" vAlign="Middle"> <reportElement x="0" y="20" width="572" height="28"/> <imageExpression class="net.sf.jasperreports.engine.JRRenderable"> <![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("/path/to/image.svg"))]]> </imageExpression></image>
  12. I know this is really really really old, but I was looking for an answer to this same question and found a solution. Thinking that someone else may come across this same question for the same reason, this will place the question and solution together for those who follow. I found the solution here: http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=64262 This allows you to use an SVG image instead of a jpg/gif in iReport. Cheers, CHgsd Code:<image hAlign="Center" vAlign="Middle"> <reportElement x="0" y="20" width="572" height="28"/> <imageExpression class="net.sf.jasperreports.engine.JRRenderable"> <![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("/path/to/image.svg"))]]> </imageExpression></image>
×
×
  • Create New...