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

jadonmhale

Members
  • Posts

    8
  • Joined

  • Last visited

jadonmhale's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I know this is an old question post but what you had and solved was perfect for my problem, thank you!
  2. EDIT: The "Calculation" setting for "Count" is only counting the number of rows in the group. NOT the number of "Y"s. "Sum" only returns a "0". How do I make it calculate only in the group? This is how far I gotten: Expression: $F{Field} == "Y" ? 1:0 I set the "Calculation" setting to "Count" in the properties. Changed the class name to java.lang.Integer (this right here was splitting hairs since default was string and kept complaining to me can't cast int from string and it took me all morning to figure that I needed to change that, some things are just unneeded to be complicated) My result is every row of the dataset (over 100) and not just the people who are in the group (like 4).
  3. Hello I'm having an issue figuring out how to count the number of rows. I'll explain my delema. Person A has several people under him. Those people have a field with a boolean. My goal is to have a count for the people under Person A of the number of true boolean returns. In adition the DB lists the booleans as "Y"s and "N"s. I orginally had a quick IF statement to turn that into "1"s and "0"s. So it looks like this: Topdog person (group) Person Name Boolean Blaa, Blaa Y (details) Homes, Sherlock N Tester, Kind Y Hairs, Pulling Y Total Peps: 4 3 So for all the people I need to have a count of 3 for the trues. In crystal, all I needed to do was add the IFF statement to change the Ys to 1s and then a "Sum of @functionname" and it worked. Can hard coding it work? In C# I would make a for loop (for(int count = 0; count < max; count++)). Can this be done in Java for this one expression? Keep in mind this is NOT a table. Just a group with details.
  4. Date in my table comes from a single integer, example: 24172 To get the year: the data value is divided by 12 (no decimal). To get the month: the logic statement mods (or rest) the data value by 12. If the result is 0 then the returned logic value is 12, but if the result is not 0, the returned logic value is the data value mod (or rest) by 12 again. For the day it is just set to 1. I need this to be presented at the header of my first group. The REST mathematical function works in Jasper as tested. but when it is added to the MONTH() it is where I think my problem is, as it just returns null (tested this by just a month expression). Sorry for the confusion.
  5. No change, still says null. An update. This expression is no longer in my group 1 but now I decided to place it in the page header. This is my expression: new Date($F{YearMonth} / 12, MONTH(IF($F{YearMonth} % 12 == 0, 12, $F{YearMonth} % 12)), 1) (weird how it will error if Date is set to DATE, when rest of the variables are in caps?)
  6. I tried every evaluation time and the result is always the same....null. I'm trying this expression as I found it is the cause of my null problem but I can't find out why (part of my original expression, the previous one was only a test). MONTH(IF($F{YearMonth} % 12 == 0, 12, $F{YearMonth} % 12)) The value of YearMonth is 24172 The REST operator works as I tested it without MONTH(OBJ) (returns 4). I need month to work, because the IF statement returns an object and I need it into an integer for the DATE(INT,INT,INT) expression.
  7. Thanks for the reply. The Pattern feature reduced my original expression (the one posted was just a test for this null issue). I still get null on preview though. This is what I did: I created a variable. In the variable I added my expression. Then I created a text object in my group header. I then added the variable into the text's expression. I then previewed the document and I get 'Null'. There shouldn't be a database issue with the above expression since it should take the date object from the computer's clock.
  8. Hello, I feel like I'm pulling teeth on the expressions for Jaspersoft. I'm trying to get a date to show on my report (ANY date), but when I preview it always shows null! Here is an example of my expression. DATEFORMAT(TODAY( ),"MMMMyyyy" )
×
×
  • Create New...