Saving report parameters: user perferences

Options
kkung
edited February 11, 2022 in Analytics #1
<p><span style="font-size:medium;"><span style="font-family:calibri;">Hi,</span></span></p>
<p> </p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">We have a report which is available to many users. </span></span></p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">We would like to save for each one his preferences ie report parameters in order to make it easier for them by having these parameters already filled every time  they run the report while leaving the possibility to modify these parameters if they wish.</span></span></p>
<p> </p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">The report parameters are:</span></span></p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">A list which allow multiple values selection</span></span></p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">An input text</span></span></p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">Two date fields</span></span></p>
<p> </p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">As a solution, we may save the parameters values in a database so each time the user runs the report, we get the parameters from the database and we set them as default values.</span></span></p>
<p> </p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">So how we can do that ? if there is a better solution feel free to suggest it.</span></span></p>
<p> </p>
<p><span style="font-size:medium;"><span style="font-family:calibri;">Thanks for your help</span></span></p>

Comments

  • <p>If you want different default parameters for every user without creating a different version of the report for each user you will need some sort of repository to store those default values (flat file, database, etc.)</p>
    <p> </p>
    <p>Then, in the default value for the parameter you can use the expression builder to manually write out java script to read from that repository and set the value accordingly.</p>
    Warning No formatter is installed for the format ipb
  • <p>This is exactely what I plan to do - saving those parameters in a database et retriveing them when the user run the report.</p>
    <p>But this is the theoretical aspect.</p>
    <p> </p>
    <p>I need a practical example about how we can do that.</p>
    <p>So thanks if someone could providing this example.</p>
  • <p>By default, a BIRT report will not be able to write back to your database so that is going to be the first step is using a setup to write back into your database.</p>
    <p> </p>
    <p>Take a look at this blog post: <a data-ipb='nomediaparse' href='http://blogs.actuate.com/writing-back-to-a-database-and-other-posts-from-this-week/'>http://blogs.actuate.com/writing-back-to-a-database-and-other-posts-from-this-week/</a></p&gt;
    <p>And this DevShare: <a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/files/file/708-birt-report-with-database-write-back/'>http://developer.actuate.com/community/forum/index.php?/files/file/708-birt-report-with-database-write-back/</a></p&gt;
    <p> </p>
    <p>Those will help get you started on writing back to the database.</p>
    <p> </p>
    <p>For the report setup, you will need to add scripting to the default value section of the parameters to retrieve the applicable value from the database that stores the user parameter preference and set it as the default value for the parameter.</p>
    <p> </p>
    <p>Then, later in the report, I would say probably in beforeFactory, you will need to read the parameter values that were selected and use the writeback method you selected to write those values into the database.</p>
    <p> </p>
    <p>One thing you will need to figure out is how you are recognizing which user is running the report to uniquely identify each users properties for reading/writing to the database. Out of the box, open source BIRT is not going to have a concept of users which means the setup will vary depending on how you setup your user access and how the report is executed.</p>
    Warning No formatter is installed for the format ipb