Matrix report with text values
I wanted to run a matrix report to basically transpose rows and columns in one of our tables. The catch is that there are no values to sum up, just text values. The data itself is form submissions from a website, so each row consists of a submission id, field name, submitted value so if a user submits a request they will have multiple rows attached to the same submission id. I wanted the report to put each complete submisison in one row with the field names as columns, basically transposing the data thats in the database. I currently have a db send mail job running that runs a pivot table query and attaches the results to the email, but the recipients of the email have asked for some changes that aren't easy to accomplish using straight db mail (removing the line of dashes, adding extra lines, etc). I was looking at reporting services for more flexibility. Thanks in advance -Chris
December 20th, 2010 2:14pm

You will need to use a query to pivot the data and get it in the right format in the data set. Then it should be easy to drop on a tablix to display. Not sure a matrix would be needed. Something like this Select SubmitID,[FirstName],[LastName] From ( SELECT SubmitID,FieldName,SubmitValue FROM FormTest ) as SourceTable Pivot ( max(SubmitValue) For FieldName IN ([FirstName],[LastName]) )as PivotTable; Mike Davis, MCTS, MCITP
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2010 3:57pm

Thanks for this! I had a feeling that was the case but for the life of me couldnt figure out how to make a dataset out of a query (or in this case, a stored proc that already runs the correct pivot table). Thats when I realized that the web front end of Reporting Services wasnt the only part out there. Went into the development portion of it (directly on the server) and realized what I was missing. Thanks again. -Chris
December 22nd, 2010 8:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics