Enabling or disabling a Report Parameter dynamically

paragw09
edited February 11, 2022 in Analytics #1
<p>Hi,</p>
<p> </p>
<p>Although I am comparatively new to BIRT I have created few reports in BIRT. Right now I am facing a problem of how to enable or disable  a report parameter dynamically. I would highly appreciate some help in achieving this functionality in BIRT Designer. I am using BIRT Designer 2.5.2.</p>
<p> </p>
<p>The functionality I am looking for is as below:</p>
<p> </p>
<p>1. The user would have to select an option from a dropdown. Each option in the dropdown has a SQL query associated with it with each one of them needing additional input parameter(s).</p>
<p> </p>
<p>2. What I want to do is depending on what is selected in the dropdown mentioned in Step 1, I want to show additional parameters. For example, if the query needs "number of days" I would like to show the user a textbox and have them enter a number. Or if the SQL query needs a "start" and an "end" date I would like to show two textboxes to enter the "start" and "end" dates.</p>
<p> </p>
<p>I have figured out how to change the query dynamically in beforeOpen of the DataSet. It's a basically a bunch of if-else statements. I also have figured out how to build the result table at runtime as each query will have different output. I am doing this in beforeFactory of the report.</p>
<p> </p>
<p>I have successfully done it for the queries that do not need additional input parameter(s) but not sure how  or whether it is possible if I need to provide additional parameters for query at runtime.</p>
<p> </p>
<p>Any help will be highly appreciated. Thank you.</p>

Comments

  • <p>185 views and not one suggestion or pointers on how I can implement this functionality!  :(</p>
    <p> </p>
    <p>Guys, I would highly appreciate any help in this.</p>
    <p> </p>
    <p>Thanks!</p>
  • <p>The functionality that you require is not built into the Report Designer, but you can create a custom parameter page as described in the following link which will do what you are asking:</p>
    <p> </p>
    <p><a data-ipb='nomediaparse' href='http://blogs.opentext.com/custom-parameter-pages/'>http://blogs.opentext.com/custom-parameter-pages/</a></p&gt;
    <p> </p>
    <p>The examples provided on the linked page don't dynamically change the input controls based upon the initial user selections, but you can write code to show/hide controls in JavaScript or another language.</p>
    <p> </p>
    <p>Creating multiple reports would also work- opening a different report based upon the initial user selection from a master report.  BIRT provides a Library to reuse the redundant elements that will appear on each report which greatly simplifies the process.  This method would require manual action to create new reports when the first set of options on the report changes.  Some manual intervention would probably be required regardless of what method you use because changing the first set of options also involves changing the interface that the user sees after the initial selection is made.</p>
    <p> </p>
    <p>I hope this is helpful,</p>
    <p>Jeff</p>
    Warning No formatter is installed for the format ipb