I am using Visual Web Developer, ASP.NET 3.5 and SQL 2008 Express
I have a GridView with a datasource that contains Task WeekEnd and TaskStatus (Top Image)
I replaced the words generated in TaskStatus with an image. (Middle Image)
To do this, I used a statement
}.jpg" HeaderText="Task Status"
I have created a Stored Procedure that creates a dynamic SQL Pivot table that works well.
It has the Task as the Header, The WeekEnd on the left side and the TaskStatus is in the body.
Is it possible to replace the TaskStatus words with the image? (Bottom Image
ALTER PROCEDURE dbo.TaskStatusPivot
Declare @strSQL varchar(max)
DECLARE @cols varchar(2000)
SELECT @cols = STUFF(( SELECT DISTINCT TOP 100 PERCENT
'],[' + task
ORDER BY '],[' + task
FOR XML PATH('')
), 1, 2, '') + ']'
set @strSQL = 'select CONVERT(varchar,WeekEnd,101) as WeekEnding, ' + @cols +
' from (
select WeekEnd, Task, TaskStatus from WeekTaskStatus) o
pivot (Max(TaskStatus) for Task in (' + @cols + ')) p'