Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRN: How to optionally hide the Excel button in the report viewer ?

Status
Not open for further replies.

Auchen

MIS
Jul 4, 2004
5
0
0
DE
How can I hide a button (e.g. the Excel icon) on the report viewer toolbar based on the following runtime situations:
a) for a certain report template
b) for a certain user group (user roles are implemented in CSP)

We have a set of templates for our report authors. Starting from one of these templates the author creates a report and
legitimates user classes on the report. Depending on the template and the legitimated user classes the 'export to excel' button should be visible or not ...any ideas?

thanks in advance
Auchen
 
The buttons can be turned on/off depeneding on a user defined role into the UI security that can be defined at the system.xml within the templates\ps\Portal



<param name="ui_hide">

<CC_VIEW_TOOLS_schedule show="Administrators"/>

<CC_HEADER_MENU_logon show="Administrators"/>

<CC_HEADER_MENU_preferences show="Administrators RSUsers"/>

<CC_HEADER_MENU_about show="Administrators"/>

<CC_HEADER_MENU_help show="Administrators"/>

<CC_TOOLBAR_BUTTONS_newjobDefinition show="Administrators"/>

<CC_TOOLBAR_BUTTONS_new_page show="Administrators"/>

<CC_TOOLBAR_BUTTONS_order show="Administrators"/>

<CC_TOOLBAR_BUTTONS_newURL show="Administrators"/>



<!--RV_TOOLBAR_BUTTONS show="Administrators RSUsers"/-->



<RV_TOOLBAR_BUTTONS_HTML show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_PDF show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_XLS show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_CSV show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_singleXLS show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_XLWA show="Administrators RSUsers"/>

<RV_TOOLBAR_BUTTONS_XML show="Administrators"/>

<RV_TOOLBAR_BUTTONS_Run show="Administrators"/>

<!--RV_TOOLBAR_BUTTONS_Send show="Administrators RSUsers Consumers"/-->

<RV_TOOLBAR_BUTTONS_Save show="Administrators"/>

<RV_TOOLBAR_BUTTONS_ReportViewSave show="Administrators RSUsers"/>



<RV_HEADER_MENU_about show="Administrators"/>

</param>



Currently the elements that can be defined for the ui_hide section are limited to system defined Administrators, RSUsers, QSUsers, Consumers and Anonymous.
Do a restart od the reportnet service to e sure it reads the new xml file.

good luck,
christenhusz
 
christenhusz,

thanks for your help. Unfortunately our security model is based on user roles that are implemeted in CSP (custom security provider) and therefore we can't use the system defined roles. To make things really exciting we want to hide the excel button depending on the template a report is based upon.

Auchen
 
christenhusz,
Thanks for this useful information. I have a further question. There are 3 options for output to Excel. In Cognos Connection the buttons are displayed as Excel 2000, Excel 2000 Single Sheet and Excel 2002. Can you please tell me which RV_TOOLBAR_BUTTONS options for Excel refer to each of the options I've mentioned here (singleXLS is self explanatory)?

Thanks in advance!
 
drseuss,

Excel 2000: RV_TOOLBAR_BUTTONS_XLS
Excel 2000 Single Sheet: RV_TOOLBAR_BUTTONS_singleXLS
Excel 2002: RV_TOOLBAR_BUTTONS_XLWA

regards
auchen
 
<style>
.topRow { display: none }
</style>

Will hide all the buttons and header

Or, something similar to this javascript. just add it to your template. note: this does not work in PDF mode.

<script language=javascript>
function hideit(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(id).style.display = 'none';
}
else {
if (document.layers) { // Netscape 4
document.id.display = 'none';
}
else { // IE 4
document.all.id.style.display = 'none';
}
}
}

hideit('Run');
hideit('Save');
hideit('ReportViewSave');
hideit('Send');
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top