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

schaibaa

Members
  • Posts

    22
  • Joined

  • Last visited

schaibaa's Achievements

Apprentice

Apprentice (3/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. In iReport when you add a parameter you can add a default value. Be careful if you're using earlier version of java that do not support auto boxing. If that's the case, just use java 1.4 syntax to express your initial values.
  2. What is your variable's calculation type? What's the variable's expression? It should be: Calculation: sum Expression: $F{variableUsedForLineSums}
  3. Then you're expression is incorrect. It's just Java, whatever that variable is evaluating, is evaluating to double what you expect it to. If you can't figure it out, and it's ALWAYS double, just divide it by two. I'm not exactly sure how your report is setup, but one thing you may consider trying, is change the variable calculation type to "Sum" and in your variable expression, enter the other variable (the line sum's, or whatever they are). Set the reset type to none, etc. Post edited by: schaibaa, at: 2007/03/15 17:24
  4. Ok, I understand what you mean a bit more now. Create a new variable to only hold the sum. Make it identical to your other one. Varibales do have reset types: None: The Initial Value Expression is always ignored Report: The variable is initialized only once at the beginning of report creation by using the Initial Value Expression Page: The variable is initialized again in each new page Column: The variable is initialized again in each new column (or in each page if the report is composed by only one column) Group: The variable is initialized again in each new group (the group specified in Reset Group) So if you make the reset type to none, and make it sum up all of them, you use that seperate variable you created for your calculations.
  5. There is no way japser can do anything to the reader chosen to open your file. You may be able to close it once printed, but it won't have anything to do with jasper.
  6. org.postgresql.Driver can be found in that jar - jar name != driver name. If the file is in your iReportlib folder, it doesn't have to be on the classpath - allthough it doesn't hurt. Change your url to: Code:jdbc:«»postgresql://~~~~~~~~~~Post edited by: schaibaa, at: 2007/03/15 14:01
  7. To my knowledge iReport only supports the built in formatting. That said, there are several ways to approach the problem. Anything you write in Java on the RHS of an expression can be written in the expression field of iReport. If you know the max digits of your field, you can make a nested set of ternary "if"'s to solve it - albeit ugly, it's only presentation logic. The easier way might be to manipulate the data before it reaches iReport. Not sure what you have access to. As far as the ternary solution, check the length - if it's length is >3, then create a substring and add the " to it. Anyway, there's no quick and easy solution in iReport (that I'm aware of)
  8. Hello, You must seperate yourself from the philosophy that text fields and fields are coupled. In fact, they are completely different. iReport supports building RHS (right hand side) expressions in java, so open the proprties of your text field, go to the text field tab, and you will have access to the expression builder, as well as a simply text box to write your expression. Also, there's no ~reason~ to create a hidden field, simply create a variable that will do your running sum, and total sum - if you I'll provide some psuedo code because I don't know the Java types of the variables you're trying to divide: $V{runningSum}.intValue() / $V{totalSum).intValue() Depending on the Type of your display field, and which JRE you're using, you will have to modify that expression to compile under the version of java you're using.
  9. Bands cannot be resized dynamically - Stretch with overflow will not allow something to cross into another band.
  10. As far as I understand it, iReport will not do this for you - If you wanted to get super techical, you could do two different sets of lables, etc and use print when expressions to know which one to display. For example, print 2_line_address_version when address3 is null print 3_line_address_version when address3 is not null Any way you do it, you'll have some whitespace at the bottom or between address and city. Someone please correct if wrong.
  11. Your issue is obviously with what band your chart is in. I'd definately try some other bands, it can get a little tricky if you have groups setup. As a check, try putting it in the last page footer band, obviously that only gets printed once. If it works, then you know you have a band issue.
  12. I think you could do a better job of explaining your problem, however - from what it sounds like you need to create a group and then set the group to go to a new page when the group changes.
  13. You should buy the documentation, it's worth it - saved me a lot of trouble. Some more info on count: Count will incriment when it reaches any non-null data, therefore you have to use a single line expression to say that if it's NOT equal to your comparison, consider it null. I like using methods that return a boolean, but depending on what JRE you're using, you'll have to choose your own method. If you're returning a boolean on count simply say: $F{ProtocolName}.equals("hello") ? "count me" : null where count me could be literally anything. On the contrary, if you want to count everything that DOES NOT meet that criteria, simply change it to: $F{ProtocolName}.equals("hello") ? null : "count me"
  14. There is a bug within iReport where if you change the border to none in the element properties box, it changes it to NULL and your compiler will return an exception. Open it up in the editor of your choice and change it to "none"
  15. While I can't answer your question directly, I may be able to help with some explanation - sorry if this is knowledge you already have. Reset Type indicates when the variable will be reset to whatever is in the initial value, or null if it is blank. The only difference between reset types "none" and "report" is that if you select "none" the initial value expression will always be ignored. Hope this helps
×
×
  • Create New...