Skip to Content

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

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Sahil Gupta

    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

    (0) 
    1. Rogerio Plank Post author

      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

      (0) 
      1. Sahil Gupta

        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

        (0) 
        1. Rogerio Plank Post author

          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

          (0) 
          1. Sahil Gupta

            Hi Rogerio,

            Yes, Preferences are fine in Infoview.
            Your another blog listed below is working fine on my machine.
            http://http://scn.sap.com/community/businessobjects-web-intelligence/blog/2015/01/05/how-to-set-a-webi-document-to-autorefresh-each-n-second

            I have tried in both mode( view as well as edit) but didn’t get the output.

            Can you please share some screenshots inclusive of steps and the output, that will be more helpful.

            For Viewing the document i have added “parent.webiViewFrame.DS.arrReports.length

            &
            For Editing, i have used the previous code i.e without using parent.

            Please see below screenshot, the blank cell remain blank after applied the code.

            SCN_SS.pngMany Thanks,

            Sahil Gupta

            (0) 

Leave a Reply