Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » how to set a datetime parameter default to 11:59:59 pm
how to set a datetime parameter default to 11:59:59 pm [message #668173] Wed, 04 May 2011 10:34 Go to next message
tong123123 tong123123 is currently offline tong123123 tong123123Friend
Messages: 74
Registered: April 2011
Member
I have a report parameter which is datetime datatype, I want to set it default to 11:59:59 pm (without default a date), is this possible?
Re: how to set a datetime parameter default to 11:59:59 pm [message #668242 is a reply to message #668173] Wed, 04 May 2011 15:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

How is the user picking the date?

Jason

On 5/4/2011 6:34 AM, tong123123@yahoo.com.hk wrote:
> I have a report parameter which is datetime datatype, I want to set it
> default to 11:59:59 pm (without default a date), is this possible?
Re: how to set a datetime parameter default to 11:59:59 pm [message #668248 is a reply to message #668242] Wed, 04 May 2011 16:14 Go to previous messageGo to next message
tong123123 tong123123 is currently offline tong123123 tong123123Friend
Messages: 74
Registered: April 2011
Member
when imported to tivoli common reporting, the datetime parameter will divided to two part, one has a calendar popup to enter date, another is a clock icon to enter time.
I want the user can just select the date and the time will be default to 11:59:59pm (and this default value can be visible and modify by the user)
is this possible?

thanks in advance
Re: how to set a datetime parameter default to 11:59:59 pm [message #668264 is a reply to message #668248] Wed, 04 May 2011 18:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

what is doing the dividing? How is the parameter passed to tivoli? It
should be fairly simple to set the time but with a datetime field the
date will need to be set.

Jason

On 5/4/2011 12:14 PM, tong123123@yahoo.com.hk wrote:
> when imported to tivoli common reporting, the datetime parameter will
> divided to two part, one has a calendar popup to enter date, another is
> a clock icon to enter time.
> I want the user can just select the date and the time will be default to
> 11:59:59pm (and this default value can be visible and modify by the user)
> is this possible?
>
> thanks in advance
Re: how to set a datetime parameter default to 11:59:59 pm [message #668301 is a reply to message #668264] Thu, 05 May 2011 02:06 Go to previous messageGo to next message
tong123123 tong123123 is currently offline tong123123 tong123123Friend
Messages: 74
Registered: April 2011
Member
I do not know how to attach file in this forum.
in eclipse birt designer, it is just a datetime field (one field), but when imported to tivoli common reporting, the field is shown as two component (do not know the reason), one component has a calendar icon to enter date part, another is a clock component to enter time part, if user just enter the date without the time part, the application will assume the time is 12:00:00 am, but I want if the user just input the date, the time will be default to 11:59:59 pm.
Also, I want this default value can visible to user, otherwise, user will not know the time is default to 11:59:59 pm.
Re: how to set a datetime parameter default to 11:59:59 pm [message #668415 is a reply to message #668301] Thu, 05 May 2011 15:09 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Just select the xml view and copy and paste the xml to your response.
What does the date default to?

Jason

On 5/4/2011 10:06 PM, tong123123@yahoo.com.hk wrote:
> I do not know how to attach file in this forum.
> in eclipse birt designer, it is just a datetime field (one field), but
> when imported to tivoli common reporting, the field is shown as two
> component (do not know the reason), one component has a calendar icon to
> enter date part, another is a clock component to enter time part, if
> user just enter the date without the time part, the application will
> assume the time is 12:00:00 am, but I want if the user just input the
> date, the time will be default to 11:59:59 pm.
> Also, I want this default value can visible to user, otherwise, user
> will not know the time is default to 11:59:59 pm.
Re: how to set a datetime parameter default to 11:59:59 pm [message #668420 is a reply to message #668415] Thu, 05 May 2011 15:33 Go to previous messageGo to next message
tong123123 tong123123 is currently offline tong123123 tong123123Friend
Messages: 74
Registered: April 2011
Member
when I back to office I will attach the xml source, the date has no default now, but I think it is acceptable to set to system date:11:59:59 pm and let user see and change this default value before user enter data, how could this be accomplished?

thanks.
Re: how to set a datetime parameter default to 11:59:59 pm [message #668470 is a reply to message #668420] Thu, 05 May 2011 19:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What version of BIRT is being used?

Jason

On 5/5/2011 11:33 AM, tong123123@yahoo.com.hk wrote:
> when I back to office I will attach the xml source, the date has no
> default now, but I think it is acceptable to set to system date:11:59:59
> pm and let user see and change this default value before user enter
> data, how could this be accomplished?
>
> thanks.
Re: how to set a datetime parameter default to 11:59:59 pm [message #668545 is a reply to message #668173] Fri, 06 May 2011 07:55 Go to previous messageGo to next message
tong123123 tong123123 is currently offline tong123123 tong123123Friend
Messages: 74
Registered: April 2011
Member
birt version 2.2.1

Quote:

<property name="author">IBM Tivoli Common Reporting</property>
<property name="createdBy">Eclipse BIRT Designer Version 2.2.1.r221_v20070924 Build &lt;2.2.0.v20070924-1550></property>

Re: how to set a datetime parameter default to 11:59:59 pm [message #668665 is a reply to message #668545] Fri, 06 May 2011 15:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

It 2.2.1 it is more difficult to do than in later versions of BIRT.
Essentially you have to create a scripted dataset that you tie to the
parameter. Take a look at this example.

Jason


<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.2.1.r221_v20070924 Build &lt;2.2.0.v20070924-1550></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
Name here>></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<parameters>
<scalar-parameter name="NewParameter" id="9">
<property name="valueType">dynamic</property>
<property name="dataType">string</property>
<property name="paramType">simple</property>
<property name="controlType">list-box</property>
<property name="dataSetName">Data Set</property>
<expression name="valueExpr">dataSetRow["dt"]</expression>
<property name="mustMatch">true</property>
<property name="fixedOrder">true</property>
<property name="distinct">true</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<script-data-source name="Data Source" id="6"/>
</data-sources>
<data-sets>
<script-data-set name="Data Set" id="7">
<list-property name="resultSetHints">
<structure>
<property name="position">0</property>
<property name="name">dt</property>
<property name="dataType">date-time</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">dt</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">dt</property>
<property name="dataType">date-time</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<method name="open"><![CDATA[ii=0;]]></method>
<method name="fetch"><![CDATA[if (ii > 0 )return false;
var myDate = new Date();
myDate.setHours(11);
myDate.setMinutes(59);
myDate.setSeconds(59);

row["dt"] = myDate;
ii++;
return true;]]></method>
</script-data-set>
</data-sets>
<styles>
<style name="crosstab-cell" id="4">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
</report>


On 5/6/2011 3:55 AM, tong123123@yahoo.com.hk wrote:
> birt version 2.2.1
>
> Quote:
>> <property name="author">IBM Tivoli Common Reporting</property>
>> <property name="createdBy">Eclipse BIRT Designer Version
>> 2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550></property>
>
Re: how to set a datetime parameter default to 11:59:59 pm [message #1062030 is a reply to message #668665] Wed, 05 June 2013 13:34 Go to previous message
David Gress is currently offline David GressFriend
Messages: 2
Registered: May 2013
Junior Member
You can set up a parameter default datetime like this:
BirtDateTime.addSecond(BirtDateTime.today(), 86399)
This yeilds the current date with time of 11:59:59 PM.

You can set any time to the second this way. Just do so math to figure out what second of the day equates to the time you want.

Let me know if this is what you are looking for.
Previous Topic:Dynamic Image that changes with parameter
Next Topic:comparsion in paramter
Goto Forum:
  


Current Time: Fri Aug 23 02:06:22 GMT 2019

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

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

Back to the top