Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » report parameter type noncompliant
report parameter type noncompliant [message #539937] Mon, 14 June 2010 10:49 Go to next message
Yasin Malli is currently offline Yasin MalliFriend
Messages: 1
Registered: June 2010
Junior Member
Hi everyone...

I call a BIRT report from url like this ' https://192.168.0.158:81/reports/frameset?__report=report.rp tdesign&rid=10&__locale=en&user=admin&date=1 272130332&__overwrite=true'

and I also have a report parameter named 'date'.

My 'date' parameter from URL (above) is decimal but I use a calendar for 'date' parameter ( which its result is string format ) for my users and it only run with text-box so I can't write any expression for any type conversion.

I must convert my 'date'(decimal) parameter to datetime before rendering of report

Any help...
Re: report parameter type noncompliant [message #539967 is a reply to message #539937] Mon, 14 June 2010 13:05 Go to previous messageGo to next message
Thomas Hergenröder is currently offline Thomas HergenröderFriend
Messages: 15
Registered: July 2009
Junior Member
You should convert it using a skript.

I assume you are using the report parameter in a dataSet?
There you have to bind the report parameters the dataSet parameters.
While you are doing that you can modify them using javascript.

old idea:
May in the initialize skript of the report.
To get to the init skript, click on a blank part of the report and then switch to the script tab of the editor.

[Updated on: Mon, 14 June 2010 13:16]

Report message to a moderator

Re: report parameter type noncompliant [message #540109 is a reply to message #539937] Mon, 14 June 2010 23:55 Go to previous message
John Ward is currently offline John WardFriend
Messages: 16
Registered: July 2009
Junior Member
In either the Initialize or BeforeFactory events in the Script tab, you would do something like:

var tempDateInput = params["date"];

//validate in some way, checking that the format is correct..
//
//

//convert to datetime if it is decimal
if (isDecimal)
{
var tempDate = new Pacakges.java.util.Date();
tempDate.setTime(Decimal.parse(tempDateInput));

//be sure to use the EXACT datemask that BIRT wants, hint provided in the parameter dialog, otherwise this will fail. The below mask is not correct, just an example
var parser = new Packages.java.text.SimpleDateFormat("mm-dd-yyyy hh:mm:ss"); params["someTempDateParamUsedInDataSet"].setValue(parser.format(tempDate));
}
else //this is the other case, where the datetimeis already set
{
params["someTempDatePramUsedInDataSet"].setValue(tempDateInput);
}


You will need to play around with the logic a little, but that should work.

John
Previous Topic:Data tools issue 2.3 series
Next Topic:Integrate BIRT in WAS 6.0
Goto Forum:
  


Current Time: Thu May 09 03:11:59 GMT 2024

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

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

Back to the top