Thursday, May 10, 2012

Issue: Browsing HTML file on Sharepoint 2010 prompt to download


Issue: When you try open a aspx/html/pdf or other such files from your SharePoint Foundation 2010 site; you are prompted for downloading the file rather than opening the file in Browser.
Resolution:
This is an enhanced feature in SharePoint Foundation 2010 and IE8.  Microsoft intentionally locked browser handling to strict to avoid malicious code execution using HTML and Java script object model. In the previous versions of SharePoint; you could open the files directly.  By default; the browser file handling option is set to strict in Central Administration
To change this setting; you need to follow the steps given below.  Please note that the steps needs to be performed in the Central Administration; which is available in your SharePoint Server.
1.    Goto Web Application and Select the WebApplication under which the Site Collection and files are located.
2.   Click on General Settings from the top “Ribbon”.
3.   Select General Setting
4.   Locate the section “Browser File Handling”
5.   Change it to Permissive.

Tuesday, May 8, 2012

Using xml path to combine multiple rows into single column


Can combine multiple row values into a single column using xml path function

select distinct employee_manager_id,
(SELECT ',' + h1.employee_id from hr.dim_employee_reporting h1
where h1.employee_manager_id=h.employee_manager_id for xml path('')) as employees
from hr.dim_employee_reporting h
where employee_manager_id = 'xxxxx'

Source reference: http://bisqlserver.rdacorp.com/2011/10/using-for-xml-path-to-combine-multiple.html