How to retrieve sharepoint list data and show it on excel-addin using C#
Hi,
we have a sharepoint list where all students are present. we wanted to get the data from the list and show it via excel addin (VSTO) (something like save,retrieve buutons) . we have some more business logic which need to be performed before the data is retrieved
. once data is shown on excel , user modifies it and update/save the record back to sharepoint.
can you please give some samples and suggest any links to start with development.
Thanks
chaitu
Hi chaituatp,
For this requirement, I would suggest you to get familiar with how to create VSTO applications, and how SharePoint object model works. Here are some sample code about this:
How to: Retrieve List Items using JavaScript:
http://msdn.microsoft.com/en-us/library/hh185007(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx
VSTO application show data in datagridview:
http://stackoverflow.com/questions/16926275/simple-example-of-vsto-excel-using-a-worksheet-as-a-datasource
Thanks,
Qiao
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Qiao Wei
TechNet Community Support
Similar Messages
-
How to access sharepoint List Data in Power Pivot model
Hi,
I have a sharepoint list and i want to access the list in power pivot workbook.
I tryed exporting the list as datafeed but iam that is missing under export.
Iam stuck pls help any other approach.?
Regards,
KrishnaaHello,
I have answered this question in this thread below:
http://social.technet.microsoft.com/Forums/office/en-US/92a04e1b-a5f7-4dbe-88e7-0a1064622641/sharepoint-list-access-in-power-pivot?forum=sqlkjpowerpointforsharepoint
Please go through the following aticles:
Using SharePoint List Data in PowerPivot:
http://msdn.microsoft.com/en-us/library/hh230322.aspx
Using a SharePoint List as a data source:
http://blogs.technet.com/b/excel_services__powerpivot_for_sharepoint_support_blog/archive/2013/07/11/excel-services-using-a-sharepoint-list-as-a-data-source.aspx
Regards,
Elvis Long
TechNet Community Support -
How to retrieve table rows data and add into DB
Hi All,
I'm a beginner in JAVAFX, I have developed a table and adding the data into the table in multiple rows. on button click I would like these rows to be added into DB.
Please could anyone help on this. I'm copy the code for reference.
CODE:
import javafx.ext.swing.SwingComponent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
package class TableColumn{
public var text: String;
package class TableCell{
public var text: String;
public var id;
public var str:String;
public var str1:String[];
public var num:Number;
package class TableRow{
public var cells: TableCell[];
package class SwingTable extends SwingComponent{
var table: JTable;
var model:DefaultTableModel;
public var selection: Integer;
public var columns: TableColumn[] on replace{
model = new DefaultTableModel(for(column in columns) column.text, 0);
table.setModel(model);
public var rows: TableRow[] on replace oldvalue[lo..hi] = newVals{
for(index in [hi..lo step -1]){
model.removeRow(index);
for(row in newVals){
model.addRow(for(cell in row.cells) cell.text);
public override function createJComponent(){
table = new JTable();
model = table.getModel() as DefaultTableModel;
var selectionModel = table.getSelectionModel();
selectionModel.addListSelectionListener(
ListSelectionListener{
public override function valueChanged(e: ListSelectionEvent ) {
selection = table.getSelectedRow();
return new JScrollPane(table);
}Instead of using a combo box, using a text ring makes it much easier to disable items in the list. Here is a vi that will do what you want. Also you can delete the last element in the table and make it enabled in the text ring for selecting again.
- tbob
Inventor of the WORM Global
Attachments:
test_table[1].vi 75 KB -
We are attempting to use SharePoint 2010 in combination with Exchange 2010 to implement shared calendars and contact lists throughout our organization. We are able to connect the lists to Outlook 2010, but have been unsuccessful in viewing
the calendars and contact lists from our mobile phones. How do we use Active Sync to view SharePoint Lists (Contacts and Calendars) on a Mobile Phone?
In trying to answer this question, we have come across a few different possibilities, all of them falling just short of a long term solution for us. After doing research, we found that Active Sync will only show the default folders of the account. To
solve this, we downloaded an Add-In for Outlook (CodeTwo FolderSync) to synchronize folders and synchronized our SharePoint list with a new Contact list in the default folder. The issue we came across with this method is that the Add-In we are using
is not capable of automatic synchronization. There is a button and it must be clicked after every update is made, which is not ideal for our solution. We then went to the company (CodeTwo) and found server side software (Exchange Sync) that they
offer which will automatically synchronize the folders. After installing that on the Exchange Server, we now are running into the issue of not being able to locate the SharePoint lists on the Exchange Server.
Does anyone happen to know how we can get to the SharePoint lists from the Exchange Server? Has anyone else been able to use shared contacts lists and calendars from SharePoint on their mobile phones using Active Sync? If so, are we in the right
direction with what we have found so far?
Thanks,
BradYou cannot use ActiveSync for that, but there are SharePoint clients for the iPhone. Windows Mobile 7 natively supports SharePoint with SharePoint Workspace Mobile, part of Microsoft Office Mobile. Android and BlackBerry might also have some apps.
Use Microsoft SharePoint Workspace Mobile
http://www.microsoft.com/windowsphone/en-us/howto/wp7/office/use-office-sharepoint-workspace-mobile.aspx
iPhone SharePoint Apps Shootout
http://www.codeproject.com/KB/iPhone/iPhoneSharePointApps.aspx
Comparing SharePoint iPhone Apps
http://blog.praecipio.com/2010/11/02/comparing-sharepoint-iphone-apps/
MCTS: Messaging | MCSE: S+M -
How to retrieve Task Lists from All Subsites to the Parent Site and display in Grid view using CAML Query + object model
do u just want task list or items under task list for all subsites
for items use spsitedataquery ref
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx use recursive to get it from alll subsite under site collection
for tasklist only u can a simply use a for loop to find in all subsite
Manish Sati -
How to create a public view for sharepoint list A and deploy this view to specific user personal view? Is that possible OOTB?
Views cannot be exported or moved. Can you elaborate your requirement?
--Cheers -
Retrieving Sharepoint List Item Information for SAP Best Approach
Hi
We have a request for retrieving Sharepoint list item information to create DVS objects in SAP. Has anybody been doing something like that, getting information out of Sharepoint into SAP? What would the best approach for this be, as usually implementations are the other way around, i.e. getting data out of SAP into Sharepoint. I think that Duet Enterprise would be an overkill for this and also requires additional licenses.
So I have been thinking using either a PI/Web Service using the Sharepoint WSDL to retrieve the information, or maybe there are also possibilities using WebDAV. There are some CL_HTTP_WEBDAV classes, but I am not sure whether and how they could be used for this.
Does anybody have how-tos or examples for either approach? Feedback is much appreciated.
Thanks,
DanielWithout using a ridiculously long workflow (which even then may not work) I do not think this is feasible in a sharepoint list. A workflow can be used to alter other fields in an item but not incrementing items like you require. You would be better changing
to data sheet view (quick edit in 2013) and changing them all manually then, or changing to terms such as priority high, low etc. Overall, no this is not really possible.
Brendan Lee -
How to display planned movement date and actual movement date together?
Hi, Professionals,
My purpose is to list delayed outbound deliveries.
Anyone could tell me how to display planned movement date and actual movement date?
Appreciate your help.Thanks Shiva.
I tried another way to do it. It works only for a short period of time.
By using VL06O, I list all outbound deliveries by limiting both planned goods movement dates and actual goods movements dates to the same week I would like to inspect. Say both from 7th/11 to 14th/11.
then I list outbound delivery list with planned goods movement date to 7th/11 but left out actual goods movements dates this time.
In excel, I compare those two lists and filter out those unique ones because those unique documents means delayed deliveries which cannot delivery according to planned date.
However, the "delayed" list generated by this method has some noises. Not all of documents are really delayed although most of them do.
I'm also looking for a way to list sales documents number of these delayed delivery documents so i can retrieve order details from it such as order value.
Help still needed. -
Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data
Expected output in Xml:
<?xml version="1.0" encoding="utf-8" ?>
- <TopRoot>
- <Root id="1" Name="Department">
- <Type id="2" Name="IT">
- <SubType id="3" Name="Technology">
<SubSubType id="4" Name="Sharepoint" />
<SubSubType id="5" Name="ASP.NET" />
<SubSubType id="6" Name="HTML 5" />
</SubType>
</Type>
</Root>
</TopRoot>
List Details:
list details for storing category / sub category data and code to build tree structure for the same.
1.Create Custom List named “CategoryDetails”:
2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
3.Create column “Parent Category” of type lookup. under Additional Column Settings.
Get information dropdown, select “CategoryDetails”.
4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
In this column dropdown, select “Category Name”:
Referance:
http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data -fine but don't want tree view just generate xml string
i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
Expected Result:
My ultimate goal is to generate xml string like above format without building tree view.
I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
I developed some code but its not working to generate xml /string.
My modified Code:
public const string DYNAMIC_CAML_QUERY =
"<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
"<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
string TreeViewStr= BuildTree();
Literal1.Text = TreeViewStr;
StringBuilder sbRoot= new StringBuilder();
protected string BuildTree()
SPList TasksList;
SPQuery objSPQuery;
StringBuilder Query = new StringBuilder();
SPListItemCollection objItems;
string DisplayColumn = string.Empty;
string Title = string.Empty;
string[] valueArray = null;
try
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb web = site.OpenWeb())
TasksList = SPContext.Current.Web.Lists["Service"];
if (TasksList != null)
objSPQuery = new SPQuery();
Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
objSPQuery.Query = Query.ToString();
objItems = TasksList.GetItems(objSPQuery);
if (objItems != null && objItems.Count > 0)
foreach (SPListItem objItem in objItems)
DisplayColumn = Convert.ToString(objItem["Title"]);
Title = Convert.ToString(objItem["Title"]);
int rootId=objItem["ID"].ToString();
sbRoot.Append("<Root id="+rootId+"
Name="+Title+">");
string SRAndSUBSRTpe = CreateTree(Title, valueArray,
null, DisplayColumn, objItem["ID"].ToString());
sbRoot.Append(SRAndSUBSRTpe);
SRType.Clear();//make SRType Empty
strhtml.Clear();
SRType.Append("</Root>");
catch (Exception ex)
throw ex;
return SRType.ToString();
StringBuilder strhtml = new StringBuilder();
private string CreateTree(string RootNode, string[] valueArray,
List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
try
strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
catch (Exception ex)
throw ex;
return strhtml;
StringBuilder SRType = new StringBuilder();
private string GetSRType(string RootNode,
string[] valueArray, List<SPListItem> objListItemColn)
SPQuery objSPQuery;
SPListItemCollection objItems = null;
List<SPListItem> objNodeListItems = new List<SPListItem>();
objSPQuery = new SPQuery();
string objNodeTitle = string.Empty;
string objLookupColumn = string.Empty;
StringBuilder Query = new StringBuilder();
SPList objTaskList;
SPField spField;
string objKeyColumn;
string SrTypeCategory;
try
objTaskList = SPContext.Current.Web.Lists["Service"];
objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
Query.Append(String.Format
(DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
objSPQuery.Query = Query.ToString();
objItems = objTaskList.GetItems(objSPQuery);
foreach (SPListItem objItem in objItems)
objNodeListItems.Add(objItem);
if (objNodeListItems != null && objNodeListItems.Count > 0)
foreach (SPListItem objItem in objNodeListItems)
RootNode = Convert.ToString(objItem["Title"]);
objKeyColumn = Convert.ToString(objItem["ID"]);
objNodeTitle = Convert.ToString(objItem["Title"]);
SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
if(SrTypeCategory =="SRtYpe")
SRType.Append("<Type id="+objKeyColumn+" Name="+RootNode+ ">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SRSubTYpe")
SRType.Append("<SRSubType id="+objKeyColumn+" Name="+RootNode+
">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SubSubTYpe")
SRType.Append("<SubSubType id="+objKeyColumn+" Name="+RootNode +"
></SubSubType");
SRType.Append("</SubType>");
SRType.Append("</Type>");
catch (Exception ex)
throw ex;
return SRType.ToString();
// Call method again (recursion) to get the child itemsHi,
According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
For example, to create or delete the ECB menu for a list item in
"Site Content and Structure", we can follow the steps below:
To add the “My Like” menu, we can add the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemLike"
runat="server"
Text="My Like"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickNavigateUrl="https://www.google.com.hk/"
/>
To remove the “Delete” menu, we can comment the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemDelete"
runat="server"
Text="<%$Resources:cms,SmtDelete%>"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickScript="%SmtObjectDeleteScript%"
/>
The result is as below:
More information:
MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
SSDT - Using a SharePoint list data feed as source - "column does not exist in the rowset" error
Hey guys!
So, I want to use a SharePoint list data to create a cube/tabular model, in order to make a complex analysis in PPS using MDX.
To create the tabular model, I'm using the SS Data Tools, and importing a feed from the respective SharePoint list (using the _vti_bin/listdata.svcextension and then selecting the list(s) I wanna to import).
Everything looks fine and smooth, I can select and preview the data in the table import wizard, but in the end, when importing, I always get this error IF the table has one or more row of data (if the table is empty, it's ok...) - the <...>
column doesn't exist in the rowset.
(Curiously, when I have the same procedure in PowerPivot for Excel, I have no problems, everything works fine. The problem is that then I get again errors if I try to create a tabular model on SSDT importing a PowerPivot file).
Here's the error:
Had you already tried this in SSDT? Are you experiencing the same trouble?
Best regards, and thanks in advance!
Jorge Mateus
Jorge MateusI noticed something else too.
I can't process Tabular Models on both SSDT and SSMS (2012), but I can process Tabular Models created on PowerPivot.
I tried to create a Data Feed connection on PowerPivot, and it was successfully created. However, if restoring the PowerPivot Tabular DB on my SSAS Tabular instance and processing (full) the model through SSMS, it won't work.
Is there anything different on PowerPivot and SSDT related with Partitioning or connections to the data sources?
Regards,
Jorge
Jorge Mateus
Update:
When trying to Restore a PowerPivot file on my SSAS Tabular Server and full process the model:
The operation failed because the source does not contain the requested column. You can fix this problem by updating the column mappings.
More Details:
The 'X' column does not exist in the rowset.
An error occurred while processing the partition 'X_81dabac5-c250-4a8c-8832-ad7fcedd35cb' in table 'X_81dabac5-c250-4a8c-8832-ad7fcedd35cb'.
The current operation was cancelled because another operation in the transaction failed.
X is the first column of the source table, no matter if I chose others on the PowerPivot table.
When trying to import data from a data feed using SSDT:
The 'X' column does not exist in the rowset.
An error occurred while processing the partition 'X_ee6be81f-2235-4113-b404-cfcb20647a38' in table 'X_ee6be81f-2235-4113-b404-cfcb20647a38'.
The current operation was cancelled because another operation in the transaction failed.
X is the first chosen column to import. -
How do I find the date and time stamp on pictures?
How do I find the date and time stamp for my pictures?
The Photos app will not do this but other apps will. iPhoto has an icon that when tapped with the photo open will show the EXIF information you are looking for. iPhoto is not free but you can purchase it in the App Store.
There may be other photo apps that provide this information as well.
PhotoForge2 will show the EXIF data as well as the GPS data if it is available. -
How do I transfer app datas and notes manually?
My mom has an old iPhone that she's handing to me. Now I want to set it up as a new iPhone but I've been using it for a while so I want MY data in there to put it in the new set up. Any help?
I've seen the Lifehacker method from 2012 (iExplorer) but I am unsure if it works. Them making a video would help.
Also the same with notes. Is there a way I can export notes from her backup to my PC then bring it to the new setup without using Outlook?
Anyways, thank you!Morning pieRr0Ur,
Article: HT4137 iOS: How to back up your data and set up as a new device should help you set it up as a new device.
Article: HT4946 iTunes: About iOS backups show everything that is backed up when it is backed up.
and
Article: HT1766 iOS: How to back up show how to backup and how iTunes will let you restore the device.
Hope this helps,
Mario -
How do I see the dates and info on gift card redeemal, purchases and other transctions?
I need to see how much was the gift card amount I originally redeemed.
How do I see the dates and info on gift card redeemal, purchases and other transactions?You can't see when gift cards were redeemed onto your account, nor what you bought with it - you can only see your entire purchase history via the Store > View Account menu option on your computer's iTunes, it won't show what payment method method was used for each item : http://support.apple.com/kb/HT2727
-
How to save a list template and make use of it in another website as webpart ?
How to save a list template and make use of it in another website as webpart ?
1. Save As "List A" as .STP
2. Go to another website, in the document workspace I try to Add webpart -> Browse -> Upload the STP file, but after that the List A webpart still doesn't appear.
Any clue which part went wrong?Hi,
firstly you need to upload the .STP file to a list solution gallery of the site and then you can add the list (under custom name) to the webpage
see here for how to-
http://office.microsoft.com/en-us/sharepoint-server-help/copy-or-move-a-list-by-using-a-list-template-HA101782479.aspx
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you -
Dynamic chart using SharePoint list data
Is it possible to create dynamic chart from SharePoint List data using OOB.
I have column Status [ choice - Pending , Submitted, Resolved ] . I want to genrate graph[Pie or Bar] show number of items in each status
V JeanThanks Lakshmanan,
But in my environment - chart webpart is not available [ restricted].
Have tried below using script.. Hope might help for other
https://www.nothingbutsharepoint.com/sites/eusp/Pages/finally-dynamic-charting-in-wss-no-code-required.aspx
V Jean
Maybe you are looking for
-
Draw something asking for apple ID all the time please help...
Hi this is my first posting so apologies if it's in wrong place etc I am one of the many people addicted to drawsomething however it's suddenly gone a bit strange. I bought some coins yesterday and now every time I go into the app it asks for my app
-
How to get the record set into array?
Hi, I want to get the record set into array in the procedure and do the processing of the array later in procedure. below is the stored procedure i am working on: procedure bulk_delete_group(p_group_id in Array_GroupListID) as begin for i in p_group_
-
For Loop with parameter in application process
Hello, I am working on a project for school and a loop in an application process is giving me a headache. I have an application from which I make an ajax call to an "on-demand" process. Here's a short version of the process: declare valuesList varcha
-
Recurring Invalid Sibling Link
Hey Everyone, I've had my 12" powerbook for perhaps a year and a half now and hadn't had a problem with up until maybe just before christmas - the problem being an invalid sibling link in the file structure. I did a lot of looking around the web abou
-
Hi, I am trying to write some code which does the following. When a use clicks on th JPanel a circle is drawn. What I now want to do is allow the user to select that circle and move it to a different position. Could anyone help me with this. I have i