Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic "Text Box" Parameter?
dwtaggart
Hi All,
I'm guessing this has been asked before, but I wasn't able to locate an answer on the forums. This seems to be a pretty common and straight forward usage of a parameter so I'm hoping someone can help me out. I'm using a couple of parameters as a "Start Date" and "End Date" to feed a Data Set. I've got those parameters marked as the "Text Box" type. What I'm looking to do is query the database for a date and pre-populate that into the start date. The majority of the time the user would leave that date, but often they will adjust.
The issue obviously is that you can't choose dynamic in order to reference a Data Set in the default value.
Thanks for any help,
Don
Find more posts tagged with
Comments
mwilliams
Hi Don,
So you want to be able to grab the first date and the last date of the database you're about to query to set the default values?
dwtaggart
Really just a default start date. I'm using javascript and todays date "new Date()" to prefill the "End Date". Of course I'm modifying it to be formatted like I want it and as a string DD-MON-YYYY.
I have a Data Set called Study Begin Data Set that uses the following query:
select min(date_start) as min_start_date from prj010017.rcr_x_cen_info;
SO, I'd like that date (min_start_date) to be the default value for the "Start Date" parameter. I'd like it to be a text box, so the user can override. However when I choose "Text Box" the dynamic option is grayed out.
Thanks,
Don
mwilliams
Don,
You could make the default value "All" or something like that, rather than a date. This would allow you to handle the value of "all" in your beforeOpen method of your dataSet to remove the where clause from your query so that all dates would be called. I don't know if there is an easy way to grab the first date in the dataSet with a textbox parameter. You could also always file an enhancement request for a feature like this.
http://www.birt-exchange.org/org/resources/bug-reporting/
kalidoss
<p>Hi all, Even i have to pass two values in single parameter with the display type of TextBox, I have tried (in ) condition in my query but ain't work, when i'm giving the input with two values it is taking the first value from the parameter textbox (ex: 1,2)</p>
<p> </p>
<p>example : SELECT b1.depart,b1.desig,a1.name,a1.salary,a1.id FROM a a1 inner join b b1 on a1.id=b1.id where a1.id in (?,?)</p>
<p> </p>
<p>Do any one have a solution for this ?</p>
<p> </p>
<p>and help me to pass two values with single parameter</p>
JFreeman
<p>A text box parameter will be interpreted as a single value and not as an array of values like a list box parameter.</p>
<p> </p>
<p>If the users are gong to be manually entering values, I think it would make the most sense to evaluate the values entered and apply them to the query though scripting.</p>
<p> </p>
<p>This can be done in the beforeOpen of the data set by using this.queryText to read and modify the query string.</p>