Convertion parameter numeric month to title month - jasper-reports

I have month parameter in JasperReports report which will be changed into title of month. I didn't use any query to change them. I try this code:
$P{MONTH}.intValue()==1?"JAN":
$P{MONTH}.intValue()==2?"FEB":
$P{MONTH}.intValue()==3?"MAR":
$P{MONTH}.intValue()==4?"APR":
$P{MONTH}.intValue()==5?"MAY":
$P{MONTH}.intValue()==6?"JUN":
$P{MONTH}.intValue()==7?"JUL":
$P{MONTH}.intValue()==8?"AUG":
$P{MONTH}.intValue()==9?"SEP":
$P{MONTH}.intValue()==10?"OCT":
$P{MONTH}.intValue()==11?"NOV":"DEC";
but it didn't work. Could anyone know the solution for me?

This is what I use
$F{MONTH}.intValue()==1?"JAN":
$F{MONTH}.intValue()==2?"FEB":
$F{MONTH}.intValue()==3?"MAR":
$F{MONTH}.intValue()==4?"APR":
$F{MONTH}.intValue()==5?"MAY":
$F{MONTH}.intValue()==6?"JUN":
$F{MONTH}.intValue()==7?"JUL":
$F{MONTH}.intValue()==8?"AUG":
$F{MONTH}.intValue()==9?"SEP":
$F{MONTH}.intValue()==10?"OCT":
$F{MONTH}.intValue()==11?"NOV":"DEC"
It may be the semi-colon at the end that's the problem
It may also be that you are using a Parameter - .intValue() doesn't seem valid for a Parameter

Related

vb6 error 380 Datepicker, bust just in certain dates

Im having a problem with a datepicker on vb6, but this jus happen on certain dates, for example 31/01/2017, but with another dates it works fine.
I appreciate the help
This almost certainly has to do with how you are setting the date in the control.
For instance if the control's value is ANY month that does not have 31 days then you will get that error. Trying to set the control to 31/02/2017 would cause an error 380.
There are two approaches you can take to fix this.
Reverse the order you set the date components.
dtFecha.Year = Year(fcsAux.Fields("xf3ch4"))
dtFecha.Month = Month(fcsAux.Fields("xf3ch4"))
dtFecha.Day = Day(fcsAux.Fields("xf3ch4"))
Set the Value property instead of the date components. dtFecha.Value = "31/02/2017"
dtFecha.Value = rcsAux.Fields("xf3ch4").Value
The first approach ensures the month is always appropriate for the day. The second approach sets the entire value at one shot and should be a valid date.

How to check if date equals date of datetime property only using query parameters

I have a DateTime property.
I want to check if a date is equal to the date in my property and it has to be done purely in the url query parameters available in OData v4.
This doesn't work :(
GET ~/odata/foo$filter=date(myProperty) eq date(1980-01-01)
Yes I can use greater then or equal but that's is already working as intended. It's equal and not equal that's the problem.
From ABNF rules, Date value is a value with format:
dateValue = year "-" month "-" day
So, I think you shouldn't add date prefix. That's:
GET ~/odata/foo$filter=date(myProperty) eq 1980-01-01
Here's some test cases provided by ODataTeam:
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L169-L171
and
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L208-L212
Besides, there's a simple tutorial you can refer to:
http://odata.github.io/WebApi/#04-04-date-and-timeofday-support
Thanks. Hope it can help.

DATEDIF statement in SharePoint not working properly

I am trying to calculate the amount of days between two dates but my formula doesn't seem to be working properly. It's as is the function is ignoring the years in the dates. My function is as follows:
=IF([Today's date]>[Expiration Date],-DATEDIF([Expiration Date],[Today's date],"d"),(DATEDIF([Today's date],[Expiration Date],"d")))
I receive this error if I use the above function(Owners removed):
But then I replace -DATEDIF([Expiration Date],[Today's date],"d") with -DATEDIF([Today's date],[Expiration Date]"d") i get this result:
This is telling me that both cases are being treated as IF([Today's date]>[Expiration Date] even though 3/24/2015 is clearly larger than 11/03/2014. Can somebody please tell me what I'm doing wrong? Thanks.
=[ExpirationDate] - [TodaysDate]

Sending parameters to report from Java code

I need to send a timestamp value as parameter from java to JR report. I tried the following code but I'm getting a blank report.
My JRXML File:
`
`
The report works fine with normal date parameter but fails to display with Time-stamp value.
My Java code :
`
I tried various values of timestamp Ex: (new java.sql.Timestamp(2013-02-27) but it is not working.
Use:
new SimpleDateFormat("yyyy-MM-dd").parse("2012-01-01");
Simply putting:
new Date(2012-01-01);
would give definitely wrong date, probably EPOCH start date.
Ensure it's MM not mm when parsing your date for month. See SimpleDateFormat javadoc
EDIT
See the image. The date your default values will generate is around 1970.
Hence your Between Condition will get all the values between 1970 to Today.
EDIT : 2
In my opinion You are setting wrong parameter in Table's datasource.
Instead of setting From_Date & To_Date from Fields set them as parameter from the main report itself.
Refer Image.

Getting individual values from GWT datebox?

I'm a newbie so please help me in this. I have a datebox with a default date format and its working and displaying selected date in the box as expected.
Now, I need to get individual values from whats being displayed/selected, i.e., month, date, year. I need them to be used to query something in database.
Example : Displayed as July 14th, 2010. I require after displaying it in box, the numeric values as 7(for month), 14(for date), 2010(for the year).
Plese help, I'll be really thankful.
_ Chirayu Diwan
DateBox has a method getValue() which returns an obect of type java.util.Date. This class has individual method to get getYear(), getMonth() (offsets with 0, so 0 is January) and getDay().