Showing posts with label Custom Button. Show all posts
Showing posts with label Custom Button. Show all posts

Thursday, May 29, 2014

Add custom button for ‘Export Current Page To Excel’

In one of our recent development we had a requirement to add a custom button dashboard for ‘Export Current Page To Excel’. We have option to export page to excel in Page Options or Export Link.



To create button we need to find ‘On Click’ event of this option. We can find properties of this link by right clicking on ‘Excel 2007+’ and Inspect element.



Following are the steps to create custom button,

    1.      Edit Dashboard and add Text from dashboard object list on the corresponding Section:




2.      Edit text and add the following HTML code :

<input id="idDashboardExportToExcelMenu" binit="true" role="menu" aria-activedescendant="popupMenuItem" aria-haspopup="true" style="width:175px;height:30px ; background-color: rgb(47, 95, 135); color: rgb(255, 255, 255); font-size:13px; font-family: Arial,sans-serif;  -moz-border-radius: 4px;
    -webkit-border-radius: 4px; cursor:pointer;border-radius: 4px; display:block; padding:4px;background-image:none; text-align:center;" onclick="return saw.dashboard.exportToExcel('@{dashboard.path}', '@{dashboard.currentPage}', true);" role="menuitem" value="Export Current Page" type="button"/>


I have used Reserved System Variables provided by OBIEE 11g.
We use '@{dashboard.path}' variable to catch dashboard path and '@{dashboard.currentPage}' variable to capture current page.

You can find list of all such Reserved system variables on following link,


    3.      Check the box “Contains HTML Markup” and save the changes.




This solution will capture entire page in excel rather than just single analysis.

Add custom button for ‘Clear My Customizations’

In one of our recent development we had a requirement to add a custom button dashboard for ‘Clear My Customizations’. By default you can find this option in Page Options drop down on Right-Top corner of Dashboard.
To create button we need to find ‘On Click’ event of this option. We can find properties of this link by right clicking on ‘Clear My Customizations’ and Inspect element.

Following are the steps to create custom button,


    1.      Edit Dashboard and add Text from dashboard object list on the corresponding Section:




    2.      Edit text and add the following HTML code :

<div class="XUIPromptEntry minibuttonOn">            <Table>                       <tr><td><input type="button" value="Clear My Customization" style="width:200px; background-color: rgb(47, 95, 135); color: rgb(255, 255, 255); font-size:13px; font-family: Arial,sans-serif;  font-weight:bold;"  onclick="return PersonalizationEditor.removeDefaultSelection(false)"></button></td></tr>          
</table>  </div>

    3.      Check the box “Contains HTML Markup” and save the changes.

Add custom button for ‘Edit Saved Customizations’

In one of our recent development we had a requirement to add a custom button dashboard for ‘Edit Saved Customizations’. By default you can find this option in Page Options drop down on Right-Top corner of Dashboard.

To create button we need to find ‘On Click’ event of this option. We can find properties of this link by right clicking on ‘Edit Saved Customizations’ and Inspect element.
Following are the steps to create custom button,

    1. Edit Dashboard and add Text from dashboard object list on the corresponding Section:






    2.   Check the box “Contains HTML Markup” and save the changes.





    3. Position Button on dashboard as per requirements.







Add custom button for ‘Save Current Customizations’

In one of our recent development we had a requirement to add a custom button dashboard for ‘Save Current Customizations’. By default you can find this option in Page Options drop down on Right-Top corner of Dashboard.
To create button we need to find ‘On Click’ event of this option. We can find properties of this link by right clicking on ‘Save Current Customizations’ and Inspect element.
Following are the steps to create custom button,

      1.  Edit Dashboard and add Text from dashboard object list on the corresponding Section:
  


      2.  Edit text and add the following HTML code :

<div class="XUIPromptEntry minibuttonOn">            <Table>                       <tr><td><input type="button" value="Save Current Customization" style="width:200px;  background-color: rgb(47, 95, 135); color: rgb(255, 255, 255); font-size:13px; font-family: Arial,sans-serif;  font-weight:bold;"  onclick="obidash.SaveCustomizationDialog.open(); return false;"></button></td></tr>    
</table>  </div>

   
     3.  Check the box “Contains HTML Markup” and save the changes.





 4. Position Button on dashboard as per your requirement.