Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » change date parameter value from script
change date parameter value from script [message #1075293] Mon, 29 July 2013 03:34 Go to next message
charles candy is currently offline charles candy
Messages: 7
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 16:55 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1560
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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: change date parameter value from script [message #1075704 is a reply to message #1075666] Mon, 29 July 2013 18:59 Go to previous messageGo to next message
charles candy is currently offline charles candy
Messages: 7
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 10:12 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1560
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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:More instance of IImageEventHandler
Next Topic:birt error while creating XLS report
Goto Forum:
  


Current Time: Thu Aug 21 23:57:39 EDT 2014

Powered by FUDForum. Page generated in 0.04099 seconds