.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to group or pivot the out put to create columns out of row outputs?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

I have a view where I have the following type of information

user_id, username, checkin_time, checkin type, checkin_#, date, location

These are currently showing in rows of each user's checkin appearing on a new row, generally each user has 4 checkins per day. The location is also the same for each date, they never change the location.

I would like to alter or pivot my results to show each checkin a user has per a particular day. For instance it would appear

userid  date  username  location checkin_time 1, checkin_time 2, checkin_time 3, checkin_time 4

1         5/18/2011  USERNAME!  home  8 AM  12PM  1 PM  6 PM


Is there an easy way to translate my current date to the output I'm seeking.

View Complete Post

More Related Resource Links

How to create scrolling table for columns in a SharePoint Designer Data View


I have a fairly complex SharePoint Designer 2007 Data View they have added two more requirements.

1. Have the columns on the right side be able to scroll left to right as there is a large number of columns, while the first 3 columns on the left side stay locked in place.  This is only one list not two, and because of some other requirements I have it must remain to be just one list.

2. Then they also need to have scrolling up and down of the entire list with the headers locked in place.

The first requirement is more important than the second, but preferrably I need to do both.

I am new to XSL so not familar with the syntax. Is this something I can do on a custom Data View? Does anyone have any examples of how?

I have a drawing that show how it needs to look but I don't see an option here to upload a graphic.

So here is a link to my graphic example uploaded to my blog area: http://lindachapman.blogspot.com/  or just the image here: http://4.bp.blogspot.com/_aB01ue__NvQ/TGL42MOvrGI/AAAAAAAAAA4/c3xP4uCy4BU/s1600/Scrolling.png

I failed to mention that 3/4 of the columns are HTML Calculated fields wh

What is the best way to create user account for big group of people?


I need to create individual account for a big group of people (around 200) from an Excel spreadsheet. What is the best practice? It will take too much time to create account using web form. I think there must be a way to do it. Please advice. I tried to use Stored procedures created by ASP.NET. NOT SURE whether it is a good idea.


Create Colors for columns in Chart , WPF

Hi, How can i dynamically create colors , which i want to asigned to the Columns in a WPF toolkit Chart control. i want the colors, which are suitable to the chart control (like the ones which are by default generated). thanks Naresh

Unable to create columns in document library after applying custom master page to site

Hi, I have applied a custom master page to a site.There is a document library in it. I am unable to add columns in it or change the default view.Nothing happens when I click on OK butoon after making my changes. However the columns are created/default view is changed when I apply the default master page. Guess I am missing some TagPrefix or sharepoint control on master page.I had solved this problem earlier in this way but don't remeber it now. Can anyone help?

dynamically create columns from xml

<?xml version="1.0" encoding="utf-8" ?> <mappings root="sound" child="item" delimiter=",">    <mapping pos="0" name="product" type="Element" />    <mapping pos="1" name="partID" type="Attribute" />    <mapping pos="2" name="numberInStock" type="Element" />    <mapping pos="3" name="numberOnOrder" type="Element" />    <mapping pos="4" name="deliveryDate" type="Element" />    <mapping pos="5" name="supplierStreet" type="Element" />    <mapping pos="6" name="supplierCompany" type="Element" />    <mapping pos="7" name="supplierPhone" type="Element" />    <mapping pos="8" name="orderedBy" type="Element" /></mappings>this is my xml file what i need is a table with 9 columns say item,product....orderedBy

Create an Excel contraining PIVOT feature in ASP.NET

Hi, We have to generate an excel sheet with pivot table from ASP.NET Web page. Please advice me with some approaches. Thanks in advance. Ratheesh 

unable to create a group using directive services -ASP.net C#

 this is what i used: public void Create(string ouPath, string name)        {            if (!DirectoryEntry.Exists("LDAP://CN=" + name + "," + ouPath))            {                try                {                    DirectoryEntry entry = new DirectoryEntry("LDAP://" + ouPath);                    DirectoryEntry group = entry.Children.Add("CN=" + name, "group");                    group.Properties["sAmAccountName"].Value = name;                    group.CommitChanges();                }               

Dynamic columns on row group page

Hi, I have a SSRS (2008 R2) report on an Olap data source. On rows I have Agents (as a row group), on columns I have Stores (as a column group) and a measure, let's say SeelOutValue. I want to see sales from agents to stores. I added a page break between each group instance on the Agent row group => one page for an Agent, but the column stores are not filtered by the Agent. I want to see on an Agent page only the stores with values. My question: can I filter the columns (Stores column group) for each Agent (row group)?  Example Dataset:             Store1 Store2 Store3 Store4 Store5  Agent1     1                   1                    1     Agent2     2         2 Agent 3  .... Now an each Agent page there are all 5 stores columns (on Agent1 page column Store2 and Store4 without data). It is possible to see on Agent1 page only Store1, Store3 and Store5 columns, on Agent2 page Store1 and Store2 columns ... ?   Thanks in advance for your help!

Unable to Merge columns outside Group ? Unnecessary Row height ?

HI , In a matrix tablix , I'm unable to merge columns outside the group . Heres a quick screen shot . http://img843.imageshack.us/img843/366/samplema.png The top 3 columns is what i meant [ Unable to Merge columns outside Group ]  and Row height of the first row ? Thanks in Advance !!Rajkumar Yelugu

Create SharePoint Security Group populated by AD query

Is there any non-code way to create a SharePoint Security Group that is populated by an AD query? The "standard" way of getting the same "effect" is to create a group that contains an AD group but that does not allow members of a particular site to see who else is also a member of the site Any thoughts?

group only selected columns of tablix

i have a simple tablix, with item in rows and sales per year in columns...so depending upon the data available, the columns will be shown..from year 2010 back to any number of years..                   year item    2010      2009    2008    current yr   current yr + last yr 123     50           80        10            50            50+80=130 abc      119          29       40         119          119+29 = 148 now, i want to have a calculated columns ( current year sales ie first column value), (last two year sales ie first two column sum) how to achieve this.

Create Collection Template Category/group

Is there a way in WSS 3.0 to create a custom group/category to hold custom templates?  I created a project template and would like to create a group for my company as opposed to having the template go into the "Custom" category.  I have searched google over an no posts are available on this topic and stsadm does not have a command for creating a group.

How to create Index on Inline View columns



i faced one problem when worked with Inline views.

For some reasons, i used Inline views in our project. Is there any possiblity to create Index on InlineViews. I will expain more clearly using my code.

select (Row_Number() over (order by Net)), * from (select ID,Fname,LName,Sal, Sal + 1000 as Net from EMP) cc where Net between 10000 and 20000

Here, ID,Fname,Lname,sal are the table columns and Net is the newly cretaed column in Inline view. I know how to create Index on table columns but i am getting struck how to create Index on Inline View columns means here i need to create index on Net column.

Thanks in Advance.....

FieldTypes for Multi Text and Person or Group Columns?


i am trying to insert an Item through List Web service.

i am able to insert, Text column fields. But unable to  insert an Image in Multi text line, and inserting dates for Date column,Person or Group  fields

Please suggest me on this

 XmlDocument doc = new XmlDocument();
           XmlElement batch = doc.CreateElement("Batch");
           batch.SetAttribute("OnError", "Continue");
           batch.SetAttribute("ListVersion", "1");
           batch.InnerXml = "<Method ID='1' Cmd='New'>" +
              "<Field Name='Title'>"+strTitle+"</Field>" +
               "<Field Name='MultiTextAnnouncement'>"+Announcement+"</Field>" +
                "<Field Name='StartDate' Type='DateTime'>" + DateTime.Now + "</Field>"

Creating a pivot of a collection and displaying it in a databound grid with dynamic columns



I'm trying to create a pivot of some data that I have about translation.

Basically what I have now is a collection of "Translation" objects which look like that :

Public Class SystemText
  Inherits Entity

#Region "Private variables"
  Private _textCategory As String
  Private _textName As String
  Private _languageCode As String
  Private _description As String
#End Region

#Region "Properties"
  Public Overridable Property TextCategory() As String

Display columns in matrix based on a group even if data don't exist in resultset


I am trying to create columns in a matrix for data that currently does not exist.  I created a matrix that groups on office name (ROWS) and Month of Appointment Date (Columns).

For example, the matrix currently looks like this.....

  January February March April

SQL MAX() function selecting ALL columns and not only those in the GROUP BY clause


A school has classes. Each class has students. Each student may take up one or several courses.

One only table with thousands of rows contains the following columns (and some others):

  1. Student´s class
  2. Student id-number
  3. Student's course
  4. Student's grade (in the course)
  5. Some other rows. This table has about 25 rows

I need an only SELECT that brings ALL ROWS for each student's highest grade (grades are numbers, not letters).

In the example bellow, I have listed a fragment of the table and I have emphasized with bold and italic characters the rows that are supposed to be selected:

          Class       ID-number     Course     Grade     Row5   Row6   Row7... 

  1. Class-A         100001     Math&n
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend