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

charlierutledge

Members
  • Posts

    5
  • 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 charlierutledge

  1. From the doc: After Detail Eval: This is called after a detail band is printed and all variables are evaluated for the current record. However, this is not the behavior I am seeing. When I change a variable value within afterDetailEval(), the new value is processed *before* the current record is printed. Example code: Integer TestInt = (Integer)this.getVariableValue("TestInt"); this.setVariableValue("TestInt", (TestInt==null ? 0 : ++TestInt)); Where TestInt is defined Class = java.lang.Integer; Calculation = System; Reset type = Report. I would expect that if you put this code in beforeDetailEval(), I would see $V{TestInt} on the first four detail rows as 0, 1, 2, 3, and that is in fact what I get. However, I would think that by moving the code to afterDetailEval() I would see $V{TestInt} on the first four detail rows as null, 0, 1, 2, which is not what I get. Instead, I get the exact same output as when the code is placed in beforeDetailEvent(). So it looks like whatever variable changes are made in afterDetailEvent() are processed BEFORE the current detail band is printed, instead of after like the doc seems to imply. Am I reading this wrong? Doing something wrong? Any pointers appreciated...
  2. I have a variable that is being set within a scriptlet in beforeDetailEval(). I can see that the variable is being set to the correct value because it displays as expected in a Text Field in the Detail band. However, when I add a Group based on the variable, no grouping occurs. It acts as if the value never changes. Is there some trick to making this work? The variable properties are Class java.lang.String, Calculation = System, Reset Type = Report, and Increment Type = None. I am using iReport 3.1.4. Thanks in advance for any pointers or suggestions...
  3. I found the problem with the value of the variable resetting. Looks like I needed to declare the variable with Rest type = Report instead of None. That made it work. Still no clue what was causing the problem with the Initial Value Expression, but turns out I don't need it anyway.
  4. After you rebuild the scriptlets jar file, how do you reload it in iReports? Is there a faster way than quitting and restarting iReports?
  5. I am trying to use a variable in conjunction with a scriptlet. I am running into a couple problems: 1. Nothing to do with the scriptlet, but I can't initialize the variable. I have a variable named TestString, class java.lang.String, Calculation = System, Reset type = None, Increment Type = none, Initial Value Expression = new String("TestVal"). When I try to run the report I get the following error: The initial value class in not compatible with the variable's class : TestString What is wrong with the Initial Value Expression? From examples, "new String("TestVal")" seems like it should do the trick. 2. Setting the variable within the scriptlet doesn't persist between detail rows. I have a Text Field in the detail section of the report with the following expression: $P{REPORT_SCRIPTLET}.TestFunction() TestFunction is declared as: public String TestFunction() throws JRScriptletException { String getString; GetString = (String)this.getVariableValue("TestString"); System.out.print("GetString before: " + GetString + "n"); // Always shows "GetString before: null" this.setVariableValue("TestString", "Testing"); GetString = (String)this.getVariableValue("TestString"); System.out.print("GetString after: " + GetString + "n"); // Always shows "GetString after: Testing" return GetString; } Every time TestFunction is invoked, it shows that the TestString variable null. It does not retain have been set to a value of "Testing" when the function was invoked for the previous row. By my understanding, the variable TestString should retain that value from row to row given the parameters it was set to (Calculation = System, Reset type = None, Increment Type = none). What am I doing wrong? I am using iReport 3.1.4, scriptlet is built using jasperreports-3.1.4.jar Any insight would beappreciated. Post Edited by Charles Rutledge at 03/20/09 23:28
×
×
  • Create New...