Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How insert date into Tex Box by JavaScript
How insert date into Tex Box by JavaScript [message #648261] Wed, 12 January 2011 07:28 Go to next message
Sergey  is currently offline Sergey Friend
Messages: 33
Registered: December 2010
Member
Hi all,

I have little problem with insert date in Text Box by Java Script.
So, I need insert current date into Text Box, and when user start report they must saw current day in this Tex Box.
I am using Birt 2.3.0. Thanks!
Re: How insert date into Tex Box by JavaScript [message #648386 is a reply to message #648261] Wed, 12 January 2011 16:20 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
as a parameter? new Date()? don't get what you want to do...

Am 12.01.11 08:28, schrieb Sergey:
> Hi all,
>
> I have little problem with insert date in Text Box by Java Script.
> So, I need insert current date into Text Box, and when user start report
> they must saw current day in this Tex Box. I am using Birt 2.3.0. Thanks!
Re: How insert date into Tex Box by JavaScript [message #648482 is a reply to message #648386] Thu, 13 January 2011 06:59 Go to previous messageGo to next message
Sergey  is currently offline Sergey Friend
Messages: 33
Registered: December 2010
Member
Wen we create new parameter, we have chance set default value, so, I need that this default value to be equal the current day. So I need write some script. Are you understanding?
Re: How insert date into Tex Box by JavaScript [message #648690 is a reply to message #648482] Fri, 14 January 2011 03:30 Go to previous messageGo to next message
Sai is currently offline SaiFriend
Messages: 2
Registered: April 2010
Junior Member
if you are using default value then add this as a java script syntax :

BirtDateTime.today()
Re: How insert date into Tex Box by JavaScript [message #648783 is a reply to message #648690] Fri, 14 January 2011 13:59 Go to previous messageGo to next message
Sergey  is currently offline Sergey Friend
Messages: 33
Registered: December 2010
Member
Component "Text Box" in Birt 2.3 not support Expression scripting, so I need write Event Handling script in report, so I need use one of event for sat current day in "Tex Box". But nothing work ... Sad Can you help me?
Re: How insert date into Tex Box by JavaScript [message #648806 is a reply to message #648261] Fri, 14 January 2011 15:22 Go to previous messageGo to next message
Leisa is currently offline LeisaFriend
Messages: 8
Registered: January 2011
Junior Member
in the OnPrepare event for the text put the following:

this.content = BirtDateTime.today();

Re: How insert date into Tex Box by JavaScript [message #648829 is a reply to message #648806] Fri, 14 January 2011 16:44 Go to previous messageGo to next message
Sergey  is currently offline Sergey Friend
Messages: 33
Registered: December 2010
Member
What element have event "onPrepare" ? I don't can find this event Sad
Re: How insert date into Tex Box by JavaScript [message #648835 is a reply to message #648261] Fri, 14 January 2011 16:57 Go to previous message
Leisa is currently offline LeisaFriend
Messages: 8
Registered: January 2011
Junior Member

    1. Click on Window Menu
    2. Click on Views
    3. Click on Outline
    4. In the Outline View, Highlight the Text field you want to show the date
    5. Go to the Script tab
    6. There should be an "onPrepare" event you can enter code for
    7. Put the following in the "onPrepare" event:
    this.content = BirtDateTime.today();


Previous Topic:radius attribute for dials
Next Topic:dynamic parameter using Internationalization
Goto Forum:
  


Current Time: Tue Mar 19 09:33:35 GMT 2024

Powered by FUDForum. Page generated in 0.02433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top