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

ali88

Members
  • Posts

    11
  • Joined

  • Last visited

ali88's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. You can check your setting again or trace the log file, to see what value passed in SQL. ;)
  2. Hi, all. Good news!! :woohoo: My report works fine now. :woohoo: It's just because one of stupid......Anyway, many many thanks for everyone's help.
  3. Hello, chrish. Thank you anyway. I just made a try for default value using condition, but still got the execption ~ ORA-01858: a non-numeric character was found where a numeric was expected About the name of parameter, I'm sure that I use the correct one. Typing D1, D2 in here just want to make my description more simple/clean.:P I made a other try:change datatype of my input control and parameter in the report. I changed them to String and it works fine.......:whistle: So now I'm wondering that why it doesn't work by using Date.:dry:
  4. Hi, all. I think I found some clues. If I quote them, the SQL query string which I can see in the log file will be SELECT col_1 FROM myTable WHERE myDate BETWEEN to_date('null', 'dd/MM/yyyy') AND TO_DATE('null','dd/MM/yyyy') If I don't quote them, it looks like: SELECT col_1 FROM myTable WHERE myDate BETWEEN to_date(null, 'dd/MM/yyyy') AND TO_DATE(null,'dd/MM/yyyy') That's why I always get empty report if I do not quote them; and always get exception if I quote them.:woohoo: I put default value in iReport, in Default value expression. Did I forget anything? :blush:
  5. Hi, chrish, thanks. I've tried the quote thing but still got invalid numeric value error from Oracle. :S So, if I don't quote them, I will always get empty report. If I quote them, I will get exception from Oracle: non-numberic.... Any suggestion? :blush:
  6. Thank you two, Lucian and Chrish. :) I run from JasperServer web interface. I think maybe I write/think too much....just beacuse I try too many ways. Let me get back to my beginning. I create 2 input control in JasperSerevr, with DataType as Date. In iReport, I add 4 parameters, 2($P{D1} and $P{D2}) as java.util.Date and they are for input control. The other 2($P{S1} and $P{S2}) are java.lang.String, I will use them for Oracle SQL.$P{D1}/$P{D2} with DefaultValue as new java.util.Date(); $P{S1}/$P{S2} with DefaultValue as new SimpleDateFormat("dd/MM/yyyy")).format($P{DATE_FROM}) Then, I create a simple Query in JasperServer, like Code: SELECT col_1 FROM myTable WHERE myDate BETWEEN to_date($P!{S1}, 'DD/MM/YYYY') and to_date($P!{S2}, 'DD/MM/YYYY') That's what I done at the beginning. But it does not work because I always get empty report. If I hard-code in that Query(e.g. specify the date), I can get the correct report. So I am pretty sure that my SQL is fine. I run from JasperServer. I use JBoss and Oracle. Many thanks for your time.:blush: Post edited by: ali88, at: 2007/08/03 07:05
  7. Thanks, Lucian. Yes, I feel strange, too. Because I wrote the code like yours at first, but it always got exception: ORA-... non-numberic ....It seens like when web-page submit $P{DATE_FROM} to server, it didn't like what we saw (e.g. I choose '01/12/2007' and then submit, I suppose that it will be '01/12/2007', but actually....no) That's why I use SimpleDateFormat to parse the date....but....it doesn't work. :unsure:
  8. Thanks, Lucian. Now my first problem is sovled. :laugh: Even I solved my first problem, I still have date format issues on my report. I have 2 issues: 1)I transfer date format from "EEE MMM dd hh:mm:ss 'CET' yyyy" to "DD/MM/YYYY" in report. Sometimes it works but sometimes doesn't. Because sometimes it causes an exception like "Unparseable date: "Tue Aug 23 00:00:00 CEST 2005". But if I change to CEST, sometimes the exception will be "Unparseable date: "Tue Aug 23 00:00:00 CET 2005" 2)If the issue 1) did not happen, I can run my report without any exception. But I always got incorrect report. What I do is: 1.(iReport)Create a simple jrxml with - a. one field: $F{COL_1} b. two parameters: $P{DATE_FROM} and $P{SDATE_FROM} $P{DATE_FROM} with java.util.Date $P{SDATE_FROM} with java.lang.String For $P{SDATE_FROM}, I have Default value expression - Code: ($P{DATE_FROM}==null?"01/01/2005":«»(new SimpleDateFormat("dd/MM/yyyy"«»)).format(( new SimpleDateFormat("EEE MMM dd hh:mm:«»ss 'CET' yyyy"«»)).parse($P{DATE_FROM}.toString()))) 2.(jasperserver)Create a Query - Code:[code] SELECT COL_1 FROM myTable WHERE myDate BETWEEN to_date($P{SDATE_FROM},'DD/MM/YYYY') AND to_date('31/12/2007','DD/MM/YYYY') 3.(jasperserver)Create a input control - DATE_FROM with DataType Date 4.(jasperserver)Create a jasperreport - this report use jrxml from 1., query from 2., and one input from 3. Finally, I run my report and always get the issues. Thanks for any help for me. :blush:
  9. Hi, Lucian. Thanks for your reply. Yes, my setting is Code: date.format=dd/MM/yyyy datetime.format=dd/MM/yyyy HH:mm calendar.date.format=%d/%m/%Y calendar.datetime.format=%d/%m/%Y %H:%M I use JBoss 4.0.5 I'm wordering that is it possible the properties files are not applied after my deployment? :dry: Thank you.
  10. Hello, chrish. Thanks for your kindly reply. Unfortunatly, I think I need to solve my another problem first.....:blush: I want to have my date format looks like 'dd/MM/yyyy'. So I follow the guide and then change the setting in the jasperserver_config.properties: Code: date.format=dd/MM/yyyy datetime.format=dd/MM/yyyy HH:mm On my jasperserver, I choose en_US as Locale and CET as TimeZone. Now, the problem is, everytime I choose the date from calendar, e.g. Dec-01-2007, it will become 01/12/07 (What I expected is 01/12/2007). Could you give me a hint or suggestion that anything I missing? Thank you. :blush:
  11. Hello, I have the same problem. When I found this example, I change my code ( just follow the example ). The good news is, no any exception happens. But, the bad news is, I always get Empty Report. :blink: I try to figure out what happen, but there is no any exception on server. I have no clues. I search the whole forum and read most of the related articles. Someone has the same problems with mine ( Empty Report ) but no one gets the feedback. :blush: I'll very appreicate that if anyone can help me or give me any suggestion. My environment: Oracle 9 jasperserver-2.0-bin jdk 1.5 Thanks a lot. :blush:
×
×
  • Create New...