Scenario We need to create KPI List and an Excel Workbook indicator programmatically. Solution 1. Create an Excel Workbook: 2. Upload that workbook to the document library on our Web site: 3. Add trusted location to Excel Services settings: 4. Create a project in Visual Studio which will do the following: SPListTemplate template = null; foreach (SPListTemplate t in sweb.ListTemplates) // sweb - SPWeb object that we initialized before { if (t.Type.ToString() == "432") // this way we can pickup the KPI List list template { template = t; break; } } Guid gG = Guid.Empty; SPList list = null; string sListTitle = "Mighty KPI List"; try { gG = sweb.Lists.Add(sListTitle, sListTitle, template); list = sweb.Lists[gG]; } catch { // exists list = sweb.Lists[sListTitle]; } // in our case we need Indicator using data in Excel workbook content type SPContentType ct = list.ContentTypes["Indicator using data in Excel workbook"]...
This blog is about SharePoint and related technologies.