Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » change date parameter value from script
change date parameter value from script [message #1075293] Mon, 29 July 2013 07:34 Go to next message
charles candy is currently offline charles candyFriend
Messages: 24
Registered: March 2013
Junior Member
Hi ,


I using MSSQL and have 2 dateset in the report
the first dataset1 is without only return a record of a field (systemdate) of a table, while the second dataset2 contain a query with 2 parameter (date_start and date_end).

when user enter the parameter 1 and 2 , what i must do is , if parameter 1 less than dataset1( systemdate) then set parameter 1 = dataset1(systemdate).


I try put script on dataset1 ->fetch event , but keep encounter problem with error convert javascript.NativeDate to java.sql.Date type


any help please ?


Re: change date parameter value from script [message #1075666 is a reply to message #1075293] Mon, 29 July 2013 20:55 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You can modify your query in the beforeOpen script method. So, one thing you could do would be to set the query to "select your_fields from your_tables" then in the beforeOpen, do something like:

this.queryText = this.queryText + " where myDate between '" + formattedStartDateString + "' and '" + formattedEndDateString + "'";

Prior to this script, you could check your parameter values to be sure they are correctly done and format the date string.


Michael

Developer Evangelist, Silanis
Re: change date parameter value from script [message #1075704 is a reply to message #1075666] Mon, 29 July 2013 22:59 Go to previous messageGo to next message
charles candy is currently offline charles candyFriend
Messages: 24
Registered: March 2013
Junior Member
Hi,

the issue is not the query . I need to change the parameter value cause I displaying the parameter value in the report header (master page)
Re: change date parameter value from script [message #1076010 is a reply to message #1075704] Tue, 30 July 2013 14:12 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Okay. So, you just need to compare the entered start parameter to the system date returned by the first dataSet? Then based on that, determine which value to show in your masterpage? If so, there are several things you could do, probably. One would be to bind the text box that you're displaying the date in your masterpage with to your systemdate dataSet. You'll have access to the data then and can compare this date and the parameter value to determine which one to show.

Hope this helps.


Michael

Developer Evangelist, Silanis
Previous Topic:More instance of IImageEventHandler
Next Topic:birt error while creating XLS report
Goto Forum:
  


Current Time: Tue Apr 16 18:47:59 GMT 2024

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

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

Back to the top