How to hide ribbon based on thebelow conditions?
I have two types of user in the site(portal and partner)
I want to hide ribbon for partner users and show ribbon for portal user.
How it can be achievd through code?
I have been applied below changes to my custom master page.
<div id="s4-ribbonrow" display:none>
and
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">
<script type="text/javascript" runat="server">
if (window.location.href.indexOf("/partner/") > -1) {
document.getElementById("s4-ribbonrow").style.display = "none";
</script>
</Sharepoint:SPSecurityTrimmedControl>
But its give below error.
"parse eror.
code bolcks are not allowed in this file."
Why the code blocked script test iin masterpage?
Could you please help why i am getting this type of error?
Place this in the web.config file of the web application within the <PageParserPath> header.
<PageParserPath VirtualPath="/BI/Pages/ppssample.aspx"
CompilationMode="Always" AllowServerSideScript="true" />
IISReset /noforce
Similar Messages
-
How to hide ribbon from all item view for particular user group
hi friends
how to hide ribbon from all item view of particular list for specific user group.
using OOB functionality or javascript.Hello,
Use this codeplex tool to hide ribbon to user group:
http://spribbonvisibility.codeplex.com/
If you don't want to use above tool then you have to add SPSecuritytrimming in "Rajiv Kumar" code for filtering based on user group permission.
http://www.topsharepoint.com/hide-the-ribbon-from-anonymous-users
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Hi,
I have a ribbon (done using ribbon XML) with menu options. I need to remove few buttons from the menu dynamically based on some condition. Also, I want to change the label of another button. How to achieve this programmatically? (C#)
Thanks in advance.
Thanks PrasadHello Prasad,
Use callbacks for populating Ribbon controls such as menu, dropDown, gallery and etc. Then you can use the
Invalidate or
InvalidateControl methods of the
IRibbonUI interface to get your callbacks invoked when required. Thus, you will be able to delete the required item(s).
You will find the following articles in MSDN helpful:
Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
To change the label of your controls at runtime you need to use the getLabel callback and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. The following series of articles describe the Fluent UI in depth:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3) -
Hi All,
I have a requirement to hide ribbon in a document library for the read permission users. I have applied SPSecurityTrimmedControl, it is working for the read permission user but for the whole site it is hiding and also unable to see the welcome control,
like user name, sign in as different user, etc.,
<Sharepoint:SPSecurityTrimmedControl runat="server" ID="spTrimRibbon" PermissionMode="All" Permissions="ManageLists">
I want to apply SPSecurityTrimmedControl to specific list/library with welcome control. Can someone please help me here.
I Appreciate your assistance...
MercuryManHello MercuryMan,
I guess you have applied your code in master page that's why it is hidden from site. To hide specific list ribbon, go to your list-->and edit the page-->then add content editor webpart and apply below script.
<SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">
<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
</div>
</SharePoint:SPSecurityTrimmedControl>
http://blogs.msdn.com/b/sharepointdev/archive/2012/04/30/how-to-hide-the-ribbon-in-sharepoint-2010-rajeswari-mohandas.aspx
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to hide a tab(not a conditional display)
I allready posted this question, but nobody answered me...
Please help. Here is the thread, just read the last message:
how to hide a tab dynamically
VitalyWhy? What are you trying to achieve? What functionality would that provide?
See
http://htmldb.oracle.com/pls/otn/f?p=24317:124
Is that what you want?
The function behind the Toggle link is
<script type="text/javascript">
function ToggleTab()
var links=document.getElementsByTagName('a');
for (var j=0;j<links.length;j++) {
if (links[j].className=='t10standardtabcurrent') {
var td=html_CascadeUpTill(links[j],'TD');
html_ToggleElement(td);
var adj=td.previousSibling;
if (adj.nodeName != 'TD') adj=adj.previousSibling;
html_ToggleElement(adj);
var adj=td.nextSibling;
if (adj.nodeName != 'TD') adj=adj.nextSibling;
html_ToggleElement(adj);
</script>Modify as per your requirements and post your final solution if you use this approach. Thanks. -
How to Hide Columns Based on Condition
Hi All,
i have an SSRS Report with below four columns.
Product_Name , Year , Credit_Amount , Debt_Amount
I want to hide the Credit_Amount Column if that column all values are Zero.
In the same way needs to hide Debt_Amount Column if that column all values are Zero.
Thanks in advance.
bala krishnaStep 1- Right click on your required Column here in below example: I wanted to hide
Name column
and select Column Visibility
Step 2- From the
Column Visibility window , select Show or hide based on an expression and
then click on fx button as shown in below screenshot
Step 3- Write Your expression in expression windows as below
=IIF(Fields!Credit_Amount.Value = 0, True, False)
Repeat step 1 to Step 3 for Debt_Amount column .
Sandip Pani http://SQLCommitted.com -
How to HIde rows based on User Selection
I have a requirement where in I have to hide some rows based on Plant Name selected by USer at the time of opening the report.
Here is the screen shot:-
Here I am seeing two Tag Types MACT and Average when User selects Luling Plant. But When User selects some other Plant I don't want to see Tag Type 'MACT' in this table.
We have a predefine filter for Plant.
How can I achieve that. The data in White Rows is Average values.
Please help.
RegardsHi Shalini,
Is user selecting Plant Name from the report prompt. If Yes, then try below-
Create a variable-
FilterSelect= If UserResponce("WritePromptTextHere") =" Luling Plant" and TagType inList ("MACT";"Average") Then 1 ElseIf UserResponce("WritePromptTextHere") <>" Luling Plant" and TagType inList ("MACT";"Average") Then 3 Else 2
Apply Filter on "FilterSelect" variable-
FilterSelect=1 and 2
~Anuj -
How to hide iviews based on the user groups?
Hi,
I have a custom role with workset, page and iviews.
The page has 5 iviews.
User group1 can see 5 iviews in the page.
Now user group2 wants see only 3 iviews in the page (same role).
Without creating another role for user group2, How can I hide the iviews based on the user group?
Is this possible?
Thanks
SundarHi Sundar,
I guess to achieve this, you have to set the permissions at iView level.
For this, go to System Admin -> Permissions -> Portal Permissions. Now navigate to your iView using the folder structure, do right-click on the iView and click on Open Permissions.
Search for the particular group and add that and assign the privileges accordingly. You can remove Everyone group from the iView .
Hope this will solve your problem.
Regards,
Saurabh Mathur -
How to hide section based on prompt selection
Hi All,
I have a requirement to hide the section based on selection of the prompt . My scenario is like i have 1 dimension table and 10 fact table joined to that dimension table. each fact table is having one code of the dimension table.
I have 10 different reports in 10 fact tables. i have defined a prompt on the dimension table , if i wil select a particular code in the prompt then it will show me that particular fact table report .
For that i have done 10 reports and i am showing in 10 different section . Now i want to hide the section based on selection .
If i can put all report in one section and based on selection i can show the report that will be also ok for me ...
Please help me ...Hi ,
i am able to show the section based on prompt selection . But in my current scenario i have 300 reports based on 300 fact table . If i will put all my report in a dashboard it will fire 300 queries to data base . It will become a performance issue . and one more thing is , does OBIEE support 300 reports in different sections in one page.
Please help me ... -
In my output fianl int. table how to display 'X' based on some conditions
Hi,
can somebody tell me
how to populate the value in my fianl table as 'X'.This is my requirement.How to do???
In the LOOP on lt_stpox, if lb_recursive is set to X, then populate gs_output-rekri = X for all components for material.
this is my coading.
*Panthom item check
IF p_phant = c_x .
DELETE lt_stpox WHERE dumps = c_y.
ENDIF.
CLEAR lb_recursive.
READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
IF sy-subrc EQ 0.
lb_recursive = 'X'.
ENDIF.
DELETE lt_stpox WHERE rekri = c_y.
LOOP AT lt_stpox INTO ls_stpox.
*Move header data to final table.
MOVE-CORRESPONDING ls_topmat TO gs_output.
*move comonent data to final table.
MOVE ls_stpox-ojtxp TO gs_output-maktx1.
MOVE ls_stpox-idnrk TO gs_output-idnrk.
MOVE ls_stpox-mngko TO gs_output-menge.
MOVE ls_stpox-rekri TO gs_output-rekri.
MOVE ls_stpox-meins TO gs_output-meins.
MOVE ls_stpox-stufe TO gs_output-dglvl.
APPEND gs_output TO gt_output.
ENDLOOP.
CLEAR: gs_output,ls_stpox,ls_topmat.
ENDLOOP.
ENDFORM. " BUILD_OUTPUTHi,
As per my understanding of your question, You are checking whether lt_stpox-rekri = 'X' in below code and then you are setting lb_recursive as 'X' accordingly.
CLEAR lb_recursive.
READ TABLE lt_stpox TRANSPORTING NO FIELDS WITH KEY rekri = 'x'.
IF sy-subrc EQ 0.
lb_recursive = 'X'.
ENDIF.
DELETE lt_stpox WHERE rekri = c_y.
And after that you are looping at lt_stpox to populate final internal table.
So, instead of doing this, you can directly loop at table lt_stpox and in loop check if lt_stpox-rekri = 'X', if yes then gs_output-rekri = X.
Refer below code.
LOOP AT lt_stpox INTO ls_stpox.
If ls_stpox-rekri eq 'X'.
gs_output-rekri = X.
Endif.
*Move header data to final table.
MOVE-CORRESPONDING ls_topmat TO gs_output.
*move comonent data to final table.
MOVE ls_stpox-ojtxp TO gs_output-maktx1.
MOVE ls_stpox-idnrk TO gs_output-idnrk.
MOVE ls_stpox-mngko TO gs_output-menge.
MOVE ls_stpox-rekri TO gs_output-rekri.
MOVE ls_stpox-meins TO gs_output-meins.
MOVE ls_stpox-stufe TO gs_output-dglvl.
APPEND gs_output TO gt_output.
ENDLOOP.
CLEAR: gs_output,ls_stpox,ls_topmat.
ENDLOOP.
Hope it helps.
Thanks,
Archana
Edited by: Archana Pawar on Feb 1, 2010 11:43 AM -
Hi ,
The scenario is " I want to Hide subform based on page condition like if page number is > 1 the subform should not print"
I have written the code Subform-initilize event in Javascript like ,
if (xfa.host.currentPage > 1)
this.presence = "hidden";
But above if condition in not working .
Please help me to solve this problem.
Regards,
Sanket.Hi Sanket,
Use following script in the initialize event of subform.
var pageNum = xfa.layout.pageCount();
if(pageNum>1){
this.presence = "hidden";
Thanks & Regards,
Sanoosh -
How to hide a row in BI Publisher using conditional formatting
Hi,
I am using BI Publisher 11.1.1.5.0.
I need to hide entire row based on the condition (if sal > 0 then hide entire row), please can you help on how can I achieve this?
thanksHi,
I've found the solution in
Report Designer's Guide for Oracle Business Intelligence Publisher Release 11g (11.1.1) Part No. E13881-02 - Section Conditional Formatting.
thanks -
How to hide the pricing conditions specified in pricing procedure of sd.
dear friends,
my situation is to hide the conditions specified in the pricing procedure. so that it is not viewed by the some users.can you please tell me how to hide the conditions. so some of the persons, who are having authorization to see the conditions , will be able to see the pricing conditions.
can you please suggest me how to do this.
regards,
g.v.shivakkumarAuthorisation issues viz. Role Impementations
Hide Condition Records Line Item & Header Wise from all the transactions QK / So / P.I. / Enquiry / Invoice etc. for specific user grps. - in CRETATE / AMEND / DISPLAY / REPORTS all
Only Display the fields
regards,
g.v.shivakkumar -
In RTF Template how to Hide a row conditionally
Hi,
Have requirement to hide Row based on condition. I have table in that 4 rows are there. Want to hide row based on condition.tried following statement didn't work.
<if@row:field!="Yes"><?end if?>
Help me to reslove this issue..
Thanks
-sriniNeed more details. What is your field name? You could try this: <?if: field!='Yes'?> (no double quotes) <?end if?>
Do you have a for-each in your code? Use it after that and enclose all the columns you want to hide between the if and end if condition.
or send me the template and xml to [email protected]
Check out the report developers guide and the row formatting section for an example as well.
You can just use an <?if:condition?> <?end if?> to do this.
Edited by: BIPuser on Apr 21, 2011 1:55 PM -
How to create a column based on a condition ?
Hi all,
I am trying to create a stored procedure that will return ID,Name and a column of type bit called called checked based on a condition
please review my code and tell me what is wrong with it
ALTER PROCEDURE [dbo].[SelectStoresNames]
AS
BEGIN
WITH locations_CTE ( ID, Name, Checked)
AS
select loc.ID,loc.Name,
(case when loc. ID in (select distinct a.StoreId
from mPromoteStores a
inner join mPromote b
on a.PromoteId=b.PromoteId
where b.promoId=144120) then 1 else 0 end as [Checked])
FROM [dbo].[mLocations] loc where SchedulePullEnabled=1 order by Name
Select *
from locations_CTE
ENDPlease post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You have no idea!
Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums.
>> I am trying to create a stored procedure that will return store_id, store_name and a column of type bit called “checked” based on a condition <<
I fixed the vague, useless, generic data elements, made wild guesses on the DDL you did not post and got rid of the assembly language bit flags (https://www.simple-talk.com/sql/t-sql-programming/bit-of-a-problem/)
1. IN (SELECT DISTINCT ..) is redundant
2. aliases in alphabetic order are no help for maintaining code
3. What is that “m” prefix? Better not be metadata...
4. We also do not use “-cte” postfixes; tell us what the table is and not how you got it. This is another version of the “vw-” or “Volkswagen” design flaw for views.
5. “promote” is a verb, so how can it have an identifier? Entities have identifiers. A set of “Promotions” could have a “promo_id”, but this might be a typo ..
6. Is “schedule_pull_enabled” another assembly language flag? I have the horrible feeling your unseen schema is not in 1NF ...
Since you did not post DDL here is as far as I can get ..
CREATE PROCEDURE Select_Stores_Names
AS
SELECT PS.store_id, PS.store_name
FROM Promote_Stores AS PS,
Promotes AS P
WHERE PS.promote_id = P.promote_id
AND P.promo_id = 144120 -- promo vs promote?
AND ???;
Want to follow the forum rules and try again?
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
Help!!
-
Hi, My printing has suddenly changed in adobe to a large scale, as in, what should be one page of print comes out as 24 pages? I havent changed anything, its happening on more than one document also, I have to stop my printer before all the pages s
-
YouTube not displaying properly in iOS 8.02
IIs anyone else having problems with YouTube app for iPad not displaying properly?ont he YouTube homepage all the what to watch videos are pushed completely to,the right hand side of the screen and will not move towards the middle of the screen Which
-
Splitting file into equal sized subfiles
My code is supposed to read in a file, and split it into 5 equal sized files. However, at the moment it is only splitting it by paragraphs, skipping a newline character, for example in the text below, the line after "...liked...mainly because it does
-
Hi, I'd like to know if the SAP CRM solution for High Ed is the same product thant the existing CRM solution? Or has it been 'tailored' for High Ed? If so, how? Is there existing documentation/presentation about it? Where has it been implemented?