Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » date input parameter in dd/MM/yyyy in birt 2.5(have the date paramter inputted in dd/mm/yyyy format)
date input parameter in dd/MM/yyyy in birt 2.5 [message #491037] Tue, 13 October 2009 01:25 Go to next message
Ben K is currently offline Ben KFriend
Messages: 27
Registered: July 2009
Junior Member
Hi i'm new to birt, i've inherited some reports that are having some problems. they were written with 2.0 designer.
I have since upgraded to 2.5 designer (with lots of headaches)
i've managed to get it working, just one problem now - we have a date input parameter.
in 2.0 it works as dd/mm/yyyy input
in 2.5 it fails validation as a valid date (for input)
it works if i change the input parameter date type to string type.

How do i change the date parameter input format to dd/mm/yyyy

also this forum is very hard to find!!
anyhow help appreciated,
cheers,
Ben
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491196 is a reply to message #491037] Tue, 13 October 2009 15:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ben,

On the parameter select the format as: and choose Custom. Enter
dd/MM/yyyy as the format. See attached example.

Jason


<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.0.v20090603 Build &lt;2.5.0.v20090617-0630></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<parameters>
<scalar-parameter name="mydate" id="7">
<property name="valueType">static</property>
<property name="dataType">date</property>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
<property name="distinct">true</property>
<structure name="format">
<property name="category">Custom</property>
<property name="pattern">dd/MM/yyyy</property>
</structure>
</scalar-parameter>
</parameters>
<styles>
<style name="report" id="4">
<property name="fontFamily">"Verdana"</property>
<property name="fontSize">10pt</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>
<style name="crosstab-cell" id="6">
<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>
<body>
<data id="8">
<list-property name="boundDataColumns">
<structure>
<property name="name">mydate</property>
<expression
name="expression">params["mydate"].value</expression>
<property name="dataType">date</property>
</structure>
</list-property>
<property name="resultSetColumn">mydate</property>
</data>
</body>
</report>


Ben K wrote:
> Hi i'm new to birt, i've inherited some reports that are having some
> problems. they were written with 2.0 designer.
> I have since upgraded to 2.5 designer (with lots of headaches)
> i've managed to get it working, just one problem now - we have a date
> input parameter.
> in 2.0 it works as dd/mm/yyyy input
> in 2.5 it fails validation as a valid date (for input)
> it works if i change the input parameter date type to string type.
>
> How do i change the date parameter input format to dd/mm/yyyy
>
> also this forum is very hard to find!!
> anyhow help appreciated,
> cheers,
> Ben
>
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491275 is a reply to message #491196] Tue, 13 October 2009 22:13 Go to previous messageGo to next message
Ben K is currently offline Ben KFriend
Messages: 27
Registered: July 2009
Junior Member
Hi Jason,
thanks for your quick response, it is much appreciated!

I have tried this method (this was the existing report structure from the v2.0 report)

but this is the error message i get:

org.eclipse.birt.report.exception.ViewerValidationException: The parameter "dtEnd" is invalid. The value "30/10/2009" is invalid with the type "dateTime".

i am calling the report like so:
server:8080/birt-viewer-2.5/run?__report=../reports2/trainin g/ClassList.rptdesign&dtStart=01/09/2009&dtEnd=30/10 /2009

and this is the relevant part of the report structure:
<parameters>
<scalar-parameter name="dtStart" id="95">
<text-property name="promptText">Start Date</text-property>
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">dateTime</property>
<property name="distinct">true</property>
<property name="paramType">simple</property>
<property name="concealValue">false</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Custom</property>
<property name="pattern">dd/MM/yyyy</property>
</structure>
</scalar-parameter>
<scalar-parameter name="dtEnd" id="96">
<text-property name="promptText">End Start</text-property>
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">dateTime</property>
<property name="distinct">true</property>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Custom</property>
<property name="pattern">dd/MM/yyyy</property>
</structure>
</scalar-parameter>


that's why i came to ask the question i thought maybe that the property pattern might be to do with the output of the input parameter rather than the input of the input parameter?


Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491281 is a reply to message #491275] Tue, 13 October 2009 23:24 Go to previous messageGo to next message
Ben K is currently offline Ben KFriend
Messages: 27
Registered: July 2009
Junior Member
is there anywhere else that the local/date setting is configured?

i'm doing more testing and when i do a preview in birt report designer, it accepts the report parameters in the right format ( dd/mm/yyyy) it is only when i copy the report to the server and run it using birt viewer that I seem to get the error.
the server is linux, report designer windows if that helps too
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491479 is a reply to message #491281] Wed, 14 October 2009 18:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ben,

Try this in the URL:

&mydate=22/11/2009&__islocale=mydate

Replace mydate with your parameter name. The __isLocale parameter
specifies that the parameter has been localized.

Jason

Ben K wrote:
> is there anywhere else that the local/date setting is configured?
>
> i'm doing more testing and when i do a preview in birt report designer,
> it accepts the report parameters in the right format ( dd/mm/yyyy) it is
> only when i copy the report to the server and run it using birt viewer
> that I seem to get the error.
> the server is linux, report designer windows if that helps too
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491538 is a reply to message #491479] Wed, 14 October 2009 22:25 Go to previous messageGo to next message
Ben K is currently offline Ben KFriend
Messages: 27
Registered: July 2009
Junior Member
Hi Jason,
Thanks again for your response!

the &__islocale=mydate setting works

is there a way to embed this setting into the rptdesign?
or configure the server to use islocale for all paramters?

I would prefer to only have to edit the birt viewer / reports than modify the application that generates link for the reports

cheers,
Ben
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491752 is a reply to message #491538] Thu, 15 October 2009 16:32 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ben,

I do not know of a way to do this.
You could open a bugzilla for this.

Jason

Ben K wrote:
> Hi Jason,
> Thanks again for your response!
>
> the &__islocale=mydate setting works
>
> is there a way to embed this setting into the rptdesign?
> or configure the server to use islocale for all paramters?
>
> I would prefer to only have to edit the birt viewer / reports than
> modify the application that generates link for the reports
>
> cheers,
> Ben
Re: date input parameter in dd/MM/yyyy in birt 2.5 [message #491822 is a reply to message #491037] Fri, 16 October 2009 01:06 Go to previous message
Ben K is currently offline Ben KFriend
Messages: 27
Registered: July 2009
Junior Member
thanks Jason.
Previous Topic:DataSet used by more that one table/grid
Next Topic:Hide Table when values not available
Goto Forum:
  


Current Time: Thu Apr 18 23:37:41 GMT 2024

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

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

Back to the top