Thursday, July 3, 2014

OBIEE - Adding "Export Entire Dashboard to Excel' link to dashboard

In the past I wrote about OBIEE - Custom Export to Excel link. Lets talk about dashboards...

As you might know in OBIEE 11.1.1.7 there is an option to export Entire Dashboard or Specific Dashboard page to excel. It exports the current page /dashboard. Here we will describe how to add such link to an Analysis or Dashboard and select the Dashboard manually.
(Done with OBIEE 11.1.1.7.140415)

This is what you can see on your OBIEE 11.1.1.7:

If you check the code behind it, you will see:

That is (with extra line breaks):
a class="NQWMenuItem NQWMenuItemWIconMixin" name="html"
href="javascript:void(null)"
onclick="return saw.dashboard.exportToExcel('/users/weblogic/_portal', 'page 1', false);"
id="popupMenuItem"
tabindex="0"
role="menuitem"
aria-label="Export Entire Dashboard">
<table class="MenuItemTable" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="MenuItemIconCell">
<img alt="" src="res/sk_blafp/catalog/exporttoexcel_ena.png">
</td>
<td class="MenuItemTextCell">Export Entire Dashboard</td>
</tr></tbody></table></a>

Since I prefer minimal code, it's:
<a href="javascript:void(null)" onclick="return saw.dashboard.exportToExcel('/users/weblogic/_portal', 'page 1', false);">Export Entire Dashboard</a>

Where:
  • "Export Entire Dashboard" is just the string we present, the one with Hyperlink. 
  • '/users/weblogic/_portal' is the path to dashboard. In this case it's "My Dashboard" of user weblogic.
  • 'page 1' is the page name in Dashboard.
  • false in "saw.dashboard.exportToExcel('/users/weblogic/_portal', 'page 1', false)" means to export Entire Dashboard, while true would export only 'page1', or any other page of the second parameter.
Now we can add it to Narrative or text in the Dashboard... And that's all.

Narrative example in an analysis:


Here is an example of exporting only page1 from dashboard test1:
<a href="javascript:void(null)" onclick="return saw.dashboard.exportToExcel('/shared/test1', 'page 1', true);">Export test1 Dashboard</a>

Adding text object to dashboard with that content:

Running it from the Dashboard:
 

The excel file is ready:


The top link in the above example is slightly more interesting since it exports the entire "My Dashboard" of user weblogic (naturally there is a security issue for non weblogic users) from another dashboard. It's the same code we have seen in the narrative above.

It works as well:


You might ask, how can I make it dynamic, so any users ca see his own "My dashboard"?
Well lets create an analysis with 1 column: VALUEOF(NQ_SESSION.USER)
And the following Narrative would do the job:
<a href="javascript:void(null)" onclick="return saw.dashboard.exportToExcel('/users/@1/_portal', 'page 1', false);">Export Entire Dashboard1</a>
(all I did was to replace "weblogic" in previous narrative with @1)



The next question is how to do the same with GO URL? I have no idea at the moment.

7 comments:

  1. Any Work Around to Export the Whole Dashboard to PPT.?

    ReplyDelete
    Replies
    1. The one thing I can think about: In 11.1.1.7, you can save the dashboard as BI Publisher report (Edit Dashboard / Print Options / Custom Print Layouts). The BI Publisher Reports can be represented as PPTX file.
      Unfortunately, the conversion to Publisher is not always perfect.

      Delete
  2. Boris,
    Any new idea how to export a whole dashboard to excel with GO URL?
    It would help a lot :) !!!
    Thank you
    Alex

    ReplyDelete
  3. Is there a simple way to make the Path and Page Name dynamic? So the same code can be reused over multiple pages?

    /wolf

    ReplyDelete
  4. Any Workaround of doing this in 11.1.1.6.4 version as it doesnt work there?I have a issue at the moment and upgrade would take another 4-5 months in Live,hence would need some customisation script that may work in obiee 11.1.1.6.4?Please help.

    Thanks,
    Utsav

    ReplyDelete
  5. Thanks ! How to export to PDF and CSV please?

    ReplyDelete
  6. But there is an option to export current page for dashboard then why to go for this method?

    ReplyDelete