Skip to main content

Posts

Create Excel from SharePoint List Data and Send by email

During my daily task allocation I came across a task in which I was supposed to create excel from SharePoint list and then send the created excel via email. The procedure was to be repeated daily. I used timer job to repeat task on daily basis. As I was unaware of the column that may exist in SharePoint list so I thought of using SharePoint views (i.e., AllItems ) to get the list of fields. Also this facilitated my code to be dynamic enough to be replaces with custom created views. Add a new class file to project: Right click project > Add > class Name class file: ListToExcelGenerator namespace xxx {     /// <summary>     /// Class to create Excel from Sharepoint List     /// </summary>     class ListToExcelGenerator     {         /// <summary>         /// Sets file path as well file name.         /// </summary>     ...

Claim Based/ Form based Authentication in SharePoint 2010

During my regular working schedule, I came across a requirement of providing a claim based authentication in SharePoint 2010.  Following are the steps I followed to achieve it: 1.    Create Database Open Visual Studio/Management Studio and create a database with appropriate name. Note SQL Server Name. Explore to C:\Windows\Microsoft.NET\Framework64\v2.0.50727 open aspnet_regsql.exe Click on Next Select Configure SQL Server for application services option and click Next button. Please see the image below: Enter SQL Server name that was noted before and Select Database that you previously created. Now Open your database and check tables in database You will find many table in your table that are automatically created.   2.     Configure Membership and Role Provider Now, create a new asp.net web application/form project open web.config . a.       By default, you will see a <connectionStrings/...