Monday 30 December 2013

Hide Quick Launch in Sharepoint 2013


         Earlier in my post , http://prasath04sharepoint.blogspot.in/2013/05/hide-top-bar-ribbon-quick-launch-in.html we had took a look on hiding quick launch controls in sharepoint 2010. Unfortunately this method doesn't work with Sharepoint 2013.

For hiding quick launch at Sharepoint 2013 we have to use different css.

To hide only Quick Launch Panel from the view

Add the following css code in the Application Page under PlaceHolderMain section.

<style type="text/css">
 #sideNavBox {DISPLAY: none}
 #contentBox {MARGIN-LEFT: 5px}
</style>

Tuesday 17 December 2013

Get Current User Email by sharepoint 2013 Object Model


Hi,


   Here we will write sharepoint 2013 object model code to retrieve current user email id. 
Use the following code.

string strUserName = HttpContext.Current.User.Identity.Name.ToString();

string strEmail = SPContext.Current.Web.AllUsers[strUserName].Email;

First we will retrieve the user name and then we will retrieve the email id.

Automation of Reports(Send reports as mail regularly)


Hi,


    I was always wondering weather i could automate reports in Sharepoint. My idea is, rather than viewing the reports from sharepoint site what if i get a daily reports by mail ? Here is the procedure on how to configure to get a daily reports via mail.

For this purpose you need a working report in shareopint site.

Choose , Microsoft SQL Server 2008 r2 à  Configuration Tools à Reporting Service Configuration Manager





















The Reporting Service Configuration Connection opens up. Ensure correct Server  Name and Report Server Instance and click Connect.


Choose E-mail Settings and provide your outgoing mail address and your server name. Click Apply and save changes.



Now point dropdown at your report and choose "Manage Subscriptions".


Click on Add Subscription.





On the To Section provide the mail address for whom the report has to be sent as mail. Also you can configure appropriate time during which the report will be delivered. In Report Contents section you can also choose the format that you wish to deliver the report(PDF, World, Excel, MHTML etc..,). Click ok and you can find the subscription is added to the report and is available.


This will deliver the report as mail to the particular mail id that was mentioned.









Monday 16 December 2013

Different types in Updating Sharepoint List


            While creating Event Receivers or Workflows we need to update the list or list items using SPListItem method. However there are different types in updating. Most commonly used are Update and SystemUpdate. lets see the different types of updates and its use.


Update()


  • Updates the item in the database.
  • Updates the “Modified” and “Modified by” values.
  • Creates a new version.

Systemupdate()


  • Updates the item in the database(List).
  • Does not update build in columns "Modified" and "Modified By".
  • Does not increment item version.
  • Triggers the item events.

Systemupdate(true)


  • Updates data to database(List).
  • Does not update build in columns "Modified" and "Modified By".
  • Will increment Item Version.

Systemupdate(false)


  • Updates data to database.
  • Does not update build in columns "Modified" and "Modified By".
  • Does not increment item version.

UpdateOverwriteVersion()


  • Updates data to database.
  • Updates build in columns "Modified" and "Modified By".
  • Does not increment new version.

Note :


You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”