Skip to Content

A script to get the number of reports and the name of them in a WEBI Document

Hi,

this blog post is about how to get the number and the names of reports in a document.

As this is a Javascript code, it will only work when viewing-editing the document in HTML mode.

The information about the reports can be found in webiViewFrame.DS.arrReports, the number of reports is given by webiViewFrame.DS.arrReports.length and the name of them is given, looping through arrReports

for (i=0;i<webiViewFrame.DS.arrReports.length-1;++i)

{ name = webiViewFrame.DS.arrReports[i].name }

To set the script, drop a blank cell over the report and set it’s text to

<script>

numberOfReports = webiViewFrame.DS.arrReports.length;

for(i = 0;i<numberOfReports-1;++i)

alert(webiViewFrame.DS.arrReports[i].name);

</script>

Set the property of the cell “Read As” to HTML.

Cheers,

Rogerio

5 Comments
You must be Logged on to comment or reply to a post.
  • Thanks for sharing Rogerio.

    I tried the above but didn’t get the output,Cell with the script and HTML view remained as it is.

    Can you please explain the steps in little more detail.

    May be there is something that i m not doing correctly.

    Thanks,

    Sahil

    • Hi Sahil, thanks fpr your message. First of all , please check to see if your using the HTML client as using javascript only works with it.

      Second, can you please tell if an error is ocurring and whats its message.

      And finally, please paste the cells contentl,

      Regards,

      Rogerio

      • Thanks Rogerio.

        yes i am using infoview (HTML) and no error is coming, screen remain as it is.

        Cell content:

        <script>

        numberOfReports = webiViewFrame.DS.arrReports.length;

        for(i = 0;i<numberOfReports-1;++i)

        alert(webiViewFrame.DS.arrReports[i].name);

        </script>

        I am running a blank report based on xyz universe and pasted this cell in that blank report.

        Please let me know if anything else i need to do or am i missing something.

        Just want to update: I am using BOXI 3.1

        Thanks,

        Sahil

        • Hi Sahil,

          but did you change the preferences for WEB INTELLIGENCE at InfoView ?

          Second thing that comes to my mind is to ask if you´re Viewing or Modifying tyhe Document ? If you´re just Viewing, you have to add parent to webiViewFrame , like :

          parent.webiViewFrame.DS.arrReports.length

          Please let me know if you´re still experiencing some problem