Using calendar object on prompt
I'm having prompt with two calendar objects - FROM and TO dates selection for setting report's time frame.
How can I show error message when user enter invalid date (typing directly in text box) or in case user select dates where FROM is after TO dates?
@ nir
Are you using 10g,if so i worked with the same solution couple of months back and it worked for me nor it caused performance issues.Its not JS script but just adding a IF statement to the existing sections if you have see the link.....Coming to 11g that im working still dint go to that extent to look back,i suppose it has been solved.
UPDATED POST
Coming to 11g there are many bugs.....i would suggest you to wait till march-april so next 11g R2 release is due to come at that period according to road map.
We cant predict anything saying this will be solved....same happened when 11gR1 many expectations where there but ended up with bugs and many unsolved issues iam facing.
We can do 1 thing hoping for best :)
Is it helpful?
By,
KK
Edited by: Kranthi on Jan 13, 2011 1:36 AM
Similar Messages
-
Using Calendar Picker (Dashboard Prompt) variable in report filter
Hi All,
I have checked the forum and it doesn't look like this was answered. I have a presentation variable "CalendarDate" for a dashboard prompt that uses the calendar picker. Has anyone found an easy way to use the presentation variable in a report filter?
I want to grab the presentation variable then use this as the criterion for the report filter.
I have tried the below for the report filter but I receive an error. Do I have to cast this value to a Date?
Date.Date <= @{CalendarDate}
Or, do I have to get the variable value and convert it to the date 'YYYY-MM-DD' format to use?
Any thoughts would be appreciated.
Thanks!
JohnSo here is what I came up with. Probably not the most efficient nor elegant but it works. I am now able to use the calendar picker variable as a date to perform date calculations.
Basically there are three scenarios for the variable value: D/M/YYYY, (DD/M/YYYY or D/MM/YYYY), DD/MM/YYYY. I use char_length function to find the length. When char length is equal to 9 there are two scenarios. If none of the scenarios work, pass the CURRENT_DATE.
code below --------
CASE CHAR_LENGTH('@{CalendarDate}')
WHEN 8 THEN CAST('date' || ' ' || char(39) || SUBSTRING('@{CalendarDate}' FROM 5 FOR 8) || '-' || CONCAT('0', SUBSTRING('@{CalendarDate}' FROM 1 FOR 1)) || '-' || CONCAT('0', SUBSTRING('@{CalendarDate}' FROM 3 FOR 1)) || char(39) AS DATE)
WHEN 9 THEN
CASE WHEN SUBSTRING('@{CalendarDate}' FROM 2 FOR 1) = '/' THEN
CAST('date' || ' ' || char(39) || SUBSTRING('@{CalendarDate}' FROM 6 FOR 9) || '-' || CONCAT('0', SUBSTRING('@{CalendarDate}' FROM 1 FOR 1)) || '-' || SUBSTRING('@{CalendarDate}' FROM 3 FOR 2) || char(39) AS DATE)
ELSE
CAST('date' || ' ' || char(39) || SUBSTRING('@{CalendarDate}' FROM 6 FOR 9) || '-' || SUBSTRING('@{CalendarDate}' FROM 1 FOR 2) || '-' || CONCAT('0', SUBSTRING('@{CalendarDate}' FROM 4 FOR 1)) || char(39) AS DATE)
END
WHEN 10 THEN
CAST('date' || ' ' || char(39) || SUBSTRING('@{CalendarDate}' FROM 7 FOR 10) || '-' || SUBSTRING('@{CalendarDate}' FROM 1 FOR 2) || '-' || SUBSTRING('@{CalendarDate}' FROM 4 FOR 2) || char(39) AS DATE)
ELSE CURRENT_DATE
END -
We have just applied some hot fixes to an application that runs Crystal reports XI. Now the calendar object no longer appears when running a parameter report based on the date. Any ideas most welcome urgently
Hi Martyn,
Please update us whether running the report through the Crystal Report designer show up the calendar object while prompting or not?
If 'No' then please update us with the following:
- What is the exact version of Crystal Reports by moving into the Crystal Report Designer->Help->About Crystal Reports.
- Please search for the 'Prompting' folder (in the drive in which the Business Objects Enterprise is installed) on a machine which display the calendra icon while prompting.
- Replace the 'Prompting' folder of the non working machine with the working machine after renaming the existing folder to .OLD.
- Now run the report again and it should show the calendar icon while prompting.
If 'Yes' then according to your application which is JAVA/.NET based post your question to the SAP Crystal Reports, version for Eclipse or SAP Crystal Reports, version for Visual Studio forum respectively.
Thanks! -
I have switched from PC to Mac over a year and a half ago, and have been plagued with the "dumb" date entry boxes in iCal and now Reminders on the mac. For one, they don't show you the DAY OF WEEK for an event, it assumes you are parked on that day, but of course reality sets in and causes constant date changes for events. Picking a date in the future would be much more helpful if Apple followed some usability norms in iCal. For instance, if you are booking a flight online, those helpful little calendar objects pop up, and further, they are smart about "end dates and times" for events, knowing it can't be earlier than the start date. Apple iCal unfortunately always thinks you are creating an ALL DAY event, and when you change the start time, it creates the end time for the next day. Not very smart. Or is it me that is not very smart for constantly hawking every little data entry field for correctness. Why, oh why dear lord has Apple not given some usability attention to iCal on the mac??? At least match the interface of the iPhone with a nice little slot machine rolling control.
Is there an add in?
Is there hope that Apple will ever fix its lagging Mail and iCal apps on the Mac?
Please advise. Or just offer a kind word of consolation if there is no hope for a better interface.In the future, Swing related questions should be posted in the Swing forum.
The code you posted is of little use since it uses custom classes so we can't see the behaviour of your code.
In general if you add a component to a Container at run time then you just use
container.revalidate()
This will invoke the LayoutManager and repaint the components in the container based on the new layout. -
Using expression to compare Calendar object
Hi,
I wonder if anyone has experience to use expression to compare Calendar object. Here is my case:
Application {
Calendar applicationDate;
What I want is something like:
expression.get("applicationDate").between(startDate, endDate);
But it is seems not working this way.
Any clue?
Thanks
HaoWhat error are you getting, in general this should work, however the Calendar will be printed/bound as a java.sql.Timestamp.
If you require to use java.sql.Date if you just want the date portion of the Calendar.
If your mapping for applicationDate sets the fieldClassification (i.e. is a TypeConversionMapping), then TopLink will automatically convert the Calendar value in the expression to the correct date type. -
How to Use a Calendar object in Forms 6i
Can any one help me how to display Calander LOV
I can't find STNDRD20.OLB and CALENDAR.PLL in my system
thx
[email protected]You have to install Forms Demo from CD and then you'll find required *.olb and *.pll. All about using calendar in Forms 6i you can find in this forum - simply search it.
Helena -
A number of difficulties using Calendars in forms 9i.
1). I can't drag/drop from the Standards object library to the forms module. The cursor remains as a cirlce with a diagonal through it.
2). Can't find Calendar.PLL ; has this been renamed in release 9i ? All I can find is OFGCALL.PLL .I use OFGCALL.PLL in Forms6i. It comes with Oracle Designer. In a Key-Listval trigger of item just put:
BEGIN
display_calendar;
END;
Also you have to put to your form:
canvases - CALENDAR, CALENDAR_TIME
window - CALENDAR
visual attributes - CALENDAR_SELECTED,
CALENDAR_SELECTED_TODAY,CALENDAR_CURR,CALENDAR_CURR_TODAY
CALENDAR_OTHER,CALENDAR_OTHER_TODAY,CALENDAR_CURR_DISABLED,
CALENDAR_CURR_DISABLED_TODAY,CALENDAR_OTHER_DISABLED,
CALENDAR_OTHER_DISABLED_TODAY
procedure - DISPLAY_CALENDAR
and attach OFGCALL.PLL library. -
Convert a calendar object to a date object
hi all...i use a calendar to select date and i want to convert the Calendar object returned to a date object ..how could i do that ?? i use the following lines of code but the Date object returned is not correct ..i mean it's not the one i chose from the calendar
Date selectedDate=new Date();
selectedDate=(calendar1.getTime());
Any one could help....thank youShow us the code where you set the calendar to your desired value. Calendar1.getTime()
should return the relevant date. -
Date change problem in Calendar object
Hi i have a calendar object for date representation.
When i need to go ahead a day i use a add method that adds a day to the Calendar object, and if the date is out of range it adjustes proerly to the next montha and proper date in that next month.
But it fails for 2 instances in a year.
From May to June and From October to November.
This i think is happenning because of the Daylight saving times in the May and October.
I try to go from May to June but it never does on it's own !! Do i have to explicitly check that for those 2 months or there is any other method ?
How can i get over it ??
Please help me with this.
ShailendraHi
There may be some other reason for it, coz Day light savings starts in last week of March, not in May.
And day light savings ends in Last week of October
Suresh -
I have a C# web service and a Java client. I am trying to access a function on my C# webservice which has one of its parameter as DateTime (C# object). When I built a SOAP Message in my Java client, how and where should I specify about the Date/Calendar object.
Need it URGENT!! Please help out. Have been searching net for couple of days.
Thanks,
SiddharthaJust an additional note. I am using JAXP for the client side Java program.
Thanks,
Siddhartha -
Using Calendar in Expression -urgent
Hai
I need your help
I am using Toplink 9.0.4.5
In my application I use Calendar to represent the Date in DataBase
Employee {
Calendar joinDate ;
In Expresion Builder
Calendar cal= Calendar.getInstance();
expression.get("joinDate ").equal(cal);
In the database it has the same value as cal but it return null values ;
If use the java.util.Date it return the values.
But In our application they force to use the Calendar
What can I do..
They is any function .. to solve this issue
Thanks in advanceIt should work. The possible reason is if you store a Date object in DATE field, its time portion is all 0. When you create a Calendar with Calendar.getInstance(), its time is the time when the Calendar is created, which is not 0. Please make sure to set the time portion correctly including millisecond. The reason java.util.Date works is that when you create a java.util.Date without time portion, it's assumed to be 0.
You can make sure the Date expression is correct by turning on logging and checking the SQL. It has to be exactly the same as what's in the database.
Shannon -
How to calculate number of days between Calendar objects
Hi,
I need to calculate the number of days between two Calendar objects. Here is some sample code:
Calendar now = Calendar.getInstance();
now.set(Calendar.HOUR_OF_DAY, 0);
now.set(Calendar.MINUTE, 0);
now.set(Calendar.SECOND, 0);
now.set(Calendar.MILLISECOND, 0);
// get a calendar that represents a day in the past
Calendar aDayInThePast = getADayInThePast();
aDayInThePast.set(Calendar.HOUR_OF_DAY, 0);
aDayInThePast.set(Calendar.MINUTE, 0);
aDayInThePast.set(Calendar.SECOND, 0);
aDayInThePast.set(Calendar.MILLISECOND, 0);
// how can I calculate the number of days ago this was??
//it would also be useful to get back a negative number if the day is in the futureMy favorite answer so far is reply 15 by Marc__: http://forum.java.sun.com/thread.jspa?threadID=488668&start=15
-
Hi, I'm not new to Java, but this seems like the best place for this question: I have some code dealing with parsing and reading schedules:
Calendar now = Calendar.getInstance();
Calendar startDateTime = (Calendar) startTime.clone();
Calendar stopDateTime = (Calendar) stopTime.clone();
startDateTime.set(Calendar.YEAR, now.get(Calendar.YEAR));
startDateTime.set(Calendar.MONTH, now.get(Calendar.MONTH));
startDateTime.set(Calendar.DATE, now.get(Calendar.DATE));
stopDateTime.set(Calendar.YEAR, now.get(Calendar.YEAR));
stopDateTime.set(Calendar.MONTH, now.get(Calendar.MONTH));
stopDateTime.set(Calendar.DATE, now.get(Calendar.DATE));
if (scheduleType == 0) //weekly
for (int i = 0; i < schedule.length(); i = i + 3)
//System.out.println (TIMEFORMAT.format(startDateTime.getTime()));
startDateTime.set(Calendar.DAY_OF_WEEK, Integer.parseInt(schedule.substring(i, i + 1)));
stopDateTime.setTime(startDateTime.getTime());
stopDateTime.add(Calendar.DATE, Integer.parseInt(schedule.substring(i + 1, i + 3)));
System.out.println (TIMEFORMAT.format(startDateTime.getTime()) + " " + TIMEFORMAT.format(new Date()) + " " + TIMEFORMAT.format(stopDateTime.getTime()));
...My out put is:
2008-11-24 09:47:00.000 2008-11-10 10:26:14.981 2008-11-27 15:00:00.000
Which is not what I though I'd get (startDateTime and stopDateTime should be 2008-11-10, 2008-11-13).
However, if I uncomment the "System.out.println(TIMEFORMAT.format(startDateTime.getTime()));" right after the if statement, my out put becomes:
2008-11-10 09:47:00.000 2008-11-10 10:27:33.924 2008-11-13 15:00:00.000
Which is what I want.
This makes no sense to me, that System.out.println is apparently "changing" something. The closet I can figure is that System.out.println gives more time for something to do something. Shrugs.
I figure I can bandaid it by setting the startDateTime/stopDateTime to (Calendar) now.clone(), and then setting the specific hour, minute, second to the stopTime/startTime instead, but this is really bugging me.
Thanks for any help.I've been working with java for 4-5 years, and I'm studying CS for my major, so I thought myself at least not new, but I suppose if the experienced say so, then I guess my self-estimation was wrong. Well, this is a good reality check.
Before anything else though, about what you said about .getTime() ("It is also setting startDateTime to the current time"). I'm under the impression that .getTime() get's the Calendar object's current time as a Date object (which as far as I've used, seems to be true) and also calculates the millisecond value. So if my Calendar is set to "January 2000", when I call .getTime() on it, do I get back a Date object set to "January 2000" (what I set it to) or "November 2008" (today's date)?
As for the program, I read in a schedule, a start_time, a stop_time (as well as the schedule_id, but that's not important) from a database, and create a schedule object. Then in one method of my Schedule object I check if the current time is in the schedule. I create startDateTime and stopDateTime objects on the fly since if the program runs overnight to the next week, a startDateTime, stopDateTime created at initialization will be wrong.
Here's a very heavily stripped down recreated version with a main and the test case I was using so you can run this.
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Schedule2
//date formatter
private static final SimpleDateFormat TIMEFORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String schedule;
Calendar startTime = Calendar.getInstance();
public Schedule2(String schedule, Date startTime)
this.schedule = schedule;
this.startTime.setTime(startTime);
public boolean nowInSchedule()
Calendar now = Calendar.getInstance();
Calendar startDateTime = (Calendar) startTime.clone(); //set the time values to correct values
startDateTime.set(Calendar.YEAR, now.get(Calendar.YEAR)); //set the year/month/date values to correct ones
startDateTime.set(Calendar.MONTH, now.get(Calendar.MONTH));
startDateTime.set(Calendar.DATE, now.get(Calendar.DATE));
for (int i = 0; i < schedule.length(); i = i + 3)
//System.out.println(TIMEFORMAT.format(startDateTime.getTime()));
startDateTime.set(Calendar.DAY_OF_WEEK, Integer.parseInt(schedule.substring(i, i + 1))); //sets current day_of_week to the one in the schedule
System.out.println(TIMEFORMAT.format(startDateTime.getTime()));
//when I check the startDateTime.getTime(), here is when I get the wrong date (2008-11-24 instead of the 10th)
return false;
public static void main(String [] args)
Calendar a = Calendar.getInstance();
a.set(1899, 12, 30, 10, 50, 0);
Schedule2 sked = new Schedule2 ("203", a.getTime());
System.out.println(sked.nowInSchedule());
}So in my test case, I had "203" as the schedule, meaning every Monday until Thursday (first digit is Monday, second two is the number of days the schedule lasts) and the start_time as "30/12/1899 10:50:00 AM".
I expected to get back "2008-11-10" since this week's Monday falls on the second, but instead I got "2008-11-24".
I did read the Calendar API, but I suppose I didn't understand it fully. .set() updates the fields, but not the millisecond value. So, maybe .set(Calendar.DAY_OF_WEEK, ...) is not doing what I think it is doing because the millisecond value isn't computed yet, and .set(Calendar.DAY_OF_WEEK, ..) seems more complicated than just setting straight YEAR/MONTH/DATE.
I'm using Java 1.4.2 BTW.
Edited by: Yi.Liu on Nov 10, 2008 12:57 PM -
Hi,
I need to get a calendar object without displaying the time (hh:mm) field. Can smone help me with this??
Thanks in advanceThanks for the replies..but my requirement is a
calendar object which i need to set in one of the
existing bean class set methods which takes in only a
calendar object (I cant modify the method signature).
I am pasting my code below..
The situation is : I get data from database as a
string read from a file which is then converted into
a format yyyy-MM-dd using a simple date format. This
returns a date object which i need to convert to
calendar without showing the time fields. The prb is
it is showing the GMT diff as default.
public static Calendar dateString2Calendar(String s)
throws ParseException {
static SimpleDateFormat df = new
SimpleDateFormat("dd-MMM-yy");
static SimpleDateFormat df1 = new
SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
1 = null;
Date d2 = null;
String S1 = null;
d1 = df.parse(s);
S1 = df1.format(d1);
d2 = df1.parse(S1);
cal.setTime(d2);
return cal;
Req output : 2004-09-07
Current output : 2004-09-07+05:30
00:00 also not allowed in the output :(The Calendar object represents a particular moment in time - it does not have a format and it always has a time portion. Do not use the toString() method to display it - if you use the System.out.println() method to display it, the toString() method is being still being called. Format the display using SimpleDateFormat as suggested. -
Calendar object with Microsoft DST patch
We have been testing changes to the 2007 daylight saving time. We applied Microsoft DST patch to Windows 2000 with Java 1.3.1_18 and Windows 2003 with Java 5.0 Update 8. On both systems the calendar object return time zone of GMT although the system clock is set for Eastern.
If the Microsoft patch is removed, the correct time zone is again returned. Has anyone else seen this behavior when Windows OS patch is applied?> Does anyone know exactly what the problem is (what has Microsoft changed) ?
a) Go to <http://www.ciac.org/ciac/bulletins/p-006.shtml> and search for the "CAN-" links. Each component has a one paragraph description.
b) According to <http://patch-info.de/IE/2004/10/12/20-35-16.html> it contains:
mshtml.dll (6,0,2800,1476 - 29,09,2004)
urlmon.dll (6,0,2800,1474 - 23,09,2004)
shdocvw.dll (6,0,2800,1584 - 27,08,2004)
wininet.dll (6,0,2800,1468 - 23,08,2004)
browseui.dll (6,0,2800,1584 - 22,08,2004)
shlwapi.dll (6,0,2800,1584 - 20,08,2004)
c) Some of the things that could be breaking are DOM references and DHTML, which are advanced features that not every application uses.
From <http://www.microsoft.com/technet/security/bulletin/MS04-038.mspx>:
"Caveats: Microsoft Knowledge Base Article 834707 <http://support.microsoft.com/?id=834707> documents the currently known issues that customers may experience when they install this security update. The article also documents recommended solutions for these issues."
Among other issues, that page says [<b>emphasis</b> added]:
- After you install the MS04-038 security updates for Internet Explorer, some dynamic HTML (DHTML) <b>drag-and-drop operations are blocked</b> by Internet Explorer.
- Security update 834707 includes a change to the way that Internet Explorer handles function pointers. This change in functionality occurs when an event handler points directly to a Document Object Model (DOM) function [...] Change in Internet Explorer function pointer behavior <b>causes code to not be executed</b> when an event handler is set to directly reference a DOM function after installing MS04-038 security updates.
BTW, Note 785308 has been updated with a workaround.
Regards,
Sean
Maybe you are looking for
-
Database connection getting reset after application server is idle
Hi, I have a centralized database with 7 to 8 tablespaces for different applications, for one of the linux based application i am having the captioned issue. The system works fine but whenever its left idle for more than 45 minutes the following scen
-
My ipod touch is stuck on the usb to itunes and itunes wont restore my ipod. Help?
My Ipod touch, 4g i think, is stuck on the USB to Itunes and when i connect it to itunes it says that i cant use it untill i restore it. So i clicked on Restore and update. It goes untill the bar at the top is fully filled then a message pops up sayi
-
Unable to run a Batch File Operating System Command
Using XI 3.0, I am unable to run a Batch File Operating System Command After Message Processing. My Batch file: gpg -se -r BOA3RSKY --armor --passphrase-fd 0 %1 < C:\Progra~1\GNU\GnuPG\gpgin My Command Line (ID scenario) exec "cmd.exe /c C:\Progra~1\
-
Datas are not coming from top to bottom in collumn
Hiiiii I am moving my data from itab to itab1. And in itab1 datas are not started from top of the collumn for each a/c no. A/CNO|AB|DZ|RV|SA 00001|00 |000|00 |10 00001|00 |000|00 |15 00001|00 |000|020|000 00002|00 |15 |000 |00 00002|21 |00 |000 |00 0
-
J2sdk 1.4.2_04 NoClass DefFoundError
Hi, This is a common error for many people but I still could not find a solution. I installed a J2SDK1.4.2_04 on XP. Then it created 2 directories: c:/j2sdk1.4.2_04 (all java tools in bin are inside) c:/Program Files/Java/j2re1.4.2_04 (librarys inclu