Im building a report that has some textboxes filters in it. Initially the report is created without any filter. My idea is that when the user clicks on a button, the filters are applied with the Textboxes that he filled and the Query is changed to have those "wheres". The concept that i am using is the following, which was answered in another topic:
Create a Report Parameter like usual, in this case 'stud_no'. Then add a comment in your SQL that you are reasonably sure is unique, I use something like --$stud_no$, wherever you want your clause inserted.
Then add a script like this to your Data Set, in beforeOpen:
this.queryText = this.queryText.replace("--$stud_no$", "and stud_no = " + params["stud_no"]);
This replaces the comment with the clause when the parameter has a value. You can use regex in the search string, and then you can also insert it multiple places if you want.
So I have two questions:
1- How can I make a Parameter receive the value of a Textbox? ;
2 - How can i make that the button calls beforeOpen() and apply the changes ?
Im sending what I have until now with my report, which is pretty much nothing at all because Im new with BIRT.