Can anyone tell me how to transform results of caml query to rows into columns.

Caml query is returning results from sharepoint list in the below format.

Column1 Column2 Column3

Value 1 Value 2 Value3

But I need the result in the below format

Column Value

Column1 Value1 Column2 Value2 Column3 Value3


You con store the results in a DataTable using SPListItemCollection.GetDataTable method.

Sample from MSDN:

SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["List_Name"];
SPListItemCollection collListItems = oList.Items;

DataGrid1.DataSource = collListItems.GetDataTable();
| improve this answer | |
  • Actually I am trying to do it with SSRS and I am trying to convert rows into columns.. – Manjunath Reddy Jul 7 '15 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.