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

slow

Members
  • Posts

    268
  • 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 slow

  1. An.other "elegant" charming version... vertical, multilanguage, single year in single A4... _________________________________________ if you like it... give me KARMA points please! : ) _________________________________________ listening: Skunk Anasie - Secretly for you, who are not there now ... Post Edited by slow at 06/25/2010 15:20
  2. I suppose your CommStatus is an Integer or a BigDecimal... so the correct form is: $F{CommStatus}.IntValue()==2 ? "Comm Failed" : "Normal" _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Nine Inch Nails - Complication
  3. try this: define a variable, date_sub, of type Long as this: new Long((new SimpleDateFormat ("yyyy.MM.dd").parse ($P{EndDate}).getTime()- new SimpleDateFormat ("yyyy.MM.dd").parse ($P{StartDate}).getTime()) /86400000L ) (use the date format you want but modify the string "yyyy.MM.dd"....) if the user give two dates wich subtraction is more than 180 days, then you can choose two way... the first is to represent only data between the start date and six months after date... the second is to represent nothing the six-month-after-start-date can be obtained declaring a variable as after_6_month_date: Date object: (new SimpleDateFormat ("yyyy.MM.dd").parse ($P{StartDate}).getTime()+86400000L*180) if you want to represent nothing you can pass to the sql statement two dates that can't be subtracted... such as 2010.01.01 and 2009.31.12 the date of a day before the start date can be obtained with a variable date_before Date object: (new SimpleDateFormat ("yyyy.MM.dd").parse ($P{StartDate}).getTime()-86400000L) so you can use a variable real_end_date setting it to: $V{date_sub}.longValue<180? $P{EndDate} : $V{after_6_month_date} if you want to show something... $V{date_sub}.longValue<180? $P{EndDate} : $V{date_before} if you want to show nothing... and then pass to the sql statement the $P{StartDate} and the $V{real_end_date} pay attention to pass only string-dates to the sql statement in the format your db exptect them... is use it... :) _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Death in Vegas - Dirge
  4. you can use the java ternary conditional operatorù operand1 ? operand2 : operand3[/code]so you can transform: String a = "" If ( cond1 ) Then a="value1" Else If ( cond2) Then a="value2" Else a="value3" in (espressione editor of variable, textfield etc...) cond1?"value1":(cond2?:"value2":"value3") _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Death in Vegas - Dirge
  5. another simple and minimal version, multilanguage, with formatted week day: a year in A4 page :) _________________________________________ if you like it... give me KARMA points please! : ) _________________________________________ listening: Underworld - dark and long (dark train)
  6. :) use the "plus" to give karma points... so people can obtain mistic power :) REMEMBER: learn java basics!
  7. I'm sorry for the delay, but the weekend I hadn't the files with me ... I'm back in the office now and so here to you the jrxml: (I need some other extra Karma "power" points to do this!! :) :) :) ) I really appreciate the work of scottj314 translating the Oracle sql in mySql sql... I haven't here a mySql installation otherwise I'll give you help doing it. I hope this little "calendar-report" work continues with other and other examples... it's a real way to learn using of iReport/JasperReports constructs... _________________________________________ if you like it... give me KARMA points please! : ) _________________________________________ listening: CSI - Io Sto Bene Post Edited by slow at 06/21/2010 12:52
  8. welcome in IReport community... I suggest to you to learn some java and ireport basics... what you ask is really simple but without basic notion seems to be very hard to do :) try this: -create a variable... call it year ( :) ) of type String, leave all parameters at default values except the espression, setting it to: (new SimpleDateFormat("yyyy")).format(new Date()) -now create a textfield in your report, of type String and set the expression to: "©2007 - "+$V{year}+" Company, Inc. All Rights Reserved." and run the report... _________________________________________ if it works... give me KARMA points please! : ) _________________________________________
  9. another version... :) single page, multilanguage, two parameters (year and language)... very basic graphic... breaks at work are very useful ... _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Death in Vegas - Dirge no words, just chills. Post Edited by slow at 06/18/2010 15:04
  10. oh... this is a good dilemma... and i like it. I suppose that you assume that the two (or more) tables have the same structure... ok? I think also tha the text you typed isn't in a sql standard format... so it isn't correct. you can obtain a similar result (I have tried it and it works fine ! :) ) with a little trick: define two string parameters: "table_name" with default value: "TEST_TABLE" and "where_sql" with default value: " 1=1" then you can declare the sql query as: select * from $P!{table_name} where $P!{where_sql} (NOTE the $P! syntax and the use of default values... without them you can't have any filed available to create the report layout) now, try to design you report and... then, you can run it passing the table name you prefer, with the where-clauses you want... obviously , the field you use in the report layout must be present in all tables wich name you want to pass as parameter _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: The Rentals - Friends of P. "If you're down with P. Well, then you're down with me. If you're friends with P. Well, then you're friends with me." (t.r.) in this case P stand for IReport $P .... :) dimenticavo... forza italia! ... quella vera. Post Edited by slow at 06/18/2010 12:03
  11. I think that a variable computed for each row coming from db can't be used to order the final result set... this because it seems to be a big cicle fetching the dataset... so if this variable is computed at time the data was retrieved, then the previous data are already computed maybe you can emulate this variable at DB level when you select the data... passing it a s a field, and using it to order the data.
  12. have you tried this is my <style isBold="true"> bold</style> topic ? _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: CSI - Io Sto Bene "non studio non lavoro non guardo la TV non vado al cinema no faccio sport io sto bene io sto male io non so cosa fare"
  13. you must create a big textfield... and then use this syntax: $f1+"\n" +$f2+"\n" +$f3 _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: CSI - Io Sto Bene "io sto bene io sto male io non so cosa fare non ho arte non ho parte non ho niente da insegnare è una questione di qualità o una formalità non ricordo più bene, una formalità" (CSI)
  14. a dirty solution... is also a solution :)
  15. I don't know what kind of chart you use in you report, but IReport uses JChart to create chart... so you can study it and customize the chart creation... try to take a look to it... maybe it can be useful
  16. It seems that you use Groovy as language for you report... try to set it to Java... and verify what happens. uhm... maybe the chart supports only Integer values...
  17. the explanation will give me some extra karma points? :) when you work with java objects the the "equal" or "==" concept must be relative to them (object)... so, when you declare: Double A = new Double(0); Double B= new Double(0); the expression if (A==B) then System.out.println("OK :) ") else System.out.println("NO :( ") will print NO :( this happen because you try to compare the value of A and B that aren't 0, but some value on memory location that contains the 0 value... so A point to a location, B point to another location... and all two location contains the 0 value... but their real values (remember A and B is a memory location!) are different. if you declare Double A = new Double(1); Double B = A; then if (A==B) then System.out.println("OK :) ") else System.out.println("NO :( ") will print OK :) only because A and B point to the same memory location... (remember that also in this case you are comparing memory location, not double values!) SO... the best (and only) way to perform a comparison is to compare the VALUES of the two variables... if (A.doubleValue()==B.doubleValue()) then System.out.println("OK :) ") else System.out.println("NO :( ") will print OK a.doubleValue() returns a basic double value, not an object... so its value can be used in algebra, comparison etc etc. -------------------------------------------- in reference to your question: $F{paymen}!= new Double(0) ? it doesn't work because $F{paymen} is a Double object... and new Double(0) is another Double object pointing to different memory location in this case use: $F{paymen}.doubleValue()!= new Double(0) .doubleValue() that is equal to: $F{paymen}.doubleValue()!= 0 the second question: $F{paymen}!= 0 ? it doesn't work because you try to compare a Double object with an int/double basic value... this mean that you try to compare a memory location value with the 0 value! the correct form is: $F{paymen}.doubleValue()!= 0 I hope what I wrote may make your ideas more clear. _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Nine Inch Nails - The Day The World Went Away Post Edited by slow at 06/15/2010 07:35
  18. in the Empty Data Source modify dialog, set a number of empty record equal to 1. (or more if you use them...) select a textfield and in the properties dialog, fint the markup element and set its value to "styled". try to use also "html" value if you prefer.
  19. 1) what you mean for static? maybe you can use "Empty datasource connection" 2) use styled text... on a text field check the "styled text" checkbox... and use: this is a text with normal and<style isBold="true">bold</style> font _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Underworld - Beautiful Burnout (Mark Knight remix)
  20. I don't use chart... but in the expression you set, if 0 and 1 are Integer values, then you must set: ( $F{x}.intValue()==0 ? "NO" : "YES" ) give feedback...
  21. use: ($F{paymen}!=null && $F{paymen}.doubleValue()!=0)?($F{payStat}+":"+$F{paymen1}.intValue()+"\n"):"" i suppose: -paymen is a Double object... and -payStat is a String and -paymen1 is a Integer. if paymen1 is a Double, then use, ($F{paymen}!=null && $F{paymen}.doubleValue()!=0)?($F{payStat}+":"+$F{paymen1}.doubleValue()+"\n"):"" _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Nine Inch Nails - Complication
  22. I'm not sure I understand your problem... but I suppose that: 1) if there is a row in the DB that presents a single field null, then you want that this field don't be compared to the relative user parameter... and the row, if pass the filter about the non-null fields, will be present in the final report. 2) i suppose also that if a field has a null value and the relative user parameter has a non blank value (lenght>0) then the row does'nt pass the filter and it isn't in the report. for this try to use: new Boolean( ($F{FIRST_NAME}!=null?($F{FIRST_NAME}.startsWith(($P{firstName}!=null && $P{firstName}.length()>0)?$P{firstName}:"")):($P{firstName}!=null && $P{firstName}.length()>0)?false:true) && ($F{LAST_NAME}!=null?($F{LAST_NAME}.startsWith(($P{lastName}!=null && $P{lastName}.length()>0)?$P{lastName}:"")):($P{lastName}!=null && $P{lastName}.length()>0)?false:true) && ($F{EMP_TYPE}!=null?($F{EMP_TYPE}.startsWith(($P{empType}!=null && $P{empType}.length()>0)?$P{empType}:"")):($P{empType}!=null && $P{empType}.length()>0)?false:true) && ($F{BUREAU}!=null?($F{BUREAU}.startsWith(($P{bureau2}!=null && $P{bureau2}.length()>0)?$P{bureau2}:"")):($P{bureau2}!=null && $P{bureau2}.length()>0)?false:true) ) note that the FIRST_NAME, LAST_NAME, EMP_TYPE, BUREAU are fields coming from DB or data source... firstName,lastName,empType,bureau2 are parameters coming from users... if you don't want the second condition (so, if it is a null field, the relative parameter would be ignored) use this: new Boolean( ($F{FIRST_NAME}!=null?($F{FIRST_NAME}.startsWith(($P{firstName}!=null && $P{firstName}.length()>0)?$P{firstName}:"")):true) && ($F{LAST_NAME}!=null?($F{LAST_NAME}.startsWith(($P{lastName}!=null && $P{lastName}.length()>0)?$P{lastName}:"")):true) && ($F{EMP_TYPE}!=null?($F{EMP_TYPE}.startsWith(($P{empType}!=null && $P{empType}.length()>0)?$P{empType}:"")):true) && ($F{BUREAU}!=null?($F{BUREAU}.startsWith(($P{bureau2}!=null && $P{bureau2}.length()>0)?$P{bureau2}:"")):true) ) if it doesn't solve your issue... try to be more more clear with an example and excuse me for not understanding... _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Nine Inch Nails - Complication
  23. I don't know what language you use... but with IReport and java your issue seems very simple to solve... I've created a similar example to yours to test a solution, but in the query editor, editing the filter expression, and adding a condition similar to this (related to yours!): new Boolean( $F{FIRST_NAME}.startsWith(($P{firstName}!=null && $P{firstName}.length()>0)?$P{firstName}:"") && $F{LAST_NAME}.startsWith(($P{lastName}!=null && $P{lastName}.length()>0)?$P{lastName}:"") && $F{EMP_TYPE}.startsWith(($P{empType}!=null && $P{empType}.length()>0)?$P{empType}:"") && $F{BUREAU}.startsWith(($P{bureau2}!=null && $P{bureau }.length()>0)?$P{bureau}:"") ) it works very well... note that the FIRST_NAME, LAST_NAME, EMP_TYPE, BUREAU are fields coming from DB or data source... firstName,lastName,empType,bureau2 are parameters coming from users... (i don't set default value for them...) so, when I haven't a string coming from user, then I compare the filed with the startinf string "" (empty!), so it is true... give me feedback... _________________________________________ if it works... give me KARMA points please! : ) _________________________________________ listening: Datura - West Line Post Edited by slow at 06/11/2010 07:49
  24. listening: Pink Floyd - Comfortably Numb Pulse 1994 (Live) all the day give me some reason to improve the calendar (working to improve it in the work breaks...in case some fussy boss read these words...) so here to you a ladscape version... multilanguage, with formatted day ... in this case the parameters are only year and language... _________________________________________ if iyou like it... give me KARMA points please! : ) _________________________________________ listening: Pink Floyd - Comfortably Numb Pulse 1994 (Live) "There is no pain you are receding A distant ship's smoke on the horizon. You are only coming through in waves. Your lips move but I can't hear what you're saying. ... I can't explain, you would not understand This is not how I am." (pf.) Post Edited by slow at 06/09/2010 14:09
×
×
  • Create New...