Im trying to create a report in SSRS. The report calls a stored procedure for its data. I want to display the data in a table. But the thing is, the result from the stored proc
One solution might be to modify your SP so that the data returned looks something like:
ColNameA DataA ColNameB DataB
AccountNumber, 1234567890, CustomerID, 948477586
AccountNumber, 5466584426, CustomerID, 458852244
Then, in SSRS drag out a table. Create a group on ColNameA. In that Group Row, place the Field ColNameA in the first Column, place ColNameB in the second column.
In the Details Row, place DataA in the first column, and DataB in the second column, and should look like this:
The sample query i used was:
select 'AccountNumber' as ColNameA, 1234567890 as DataA, 'CustomerID' as ColNameB, 0987654321 as DataB UNION
select 'AccountNumber' as ColNameA, 5546488393 as DataA, 'CustomerID' as ColNameB, 4747599393 as DataB
Getting the names of the Columns (AccountNumber, CustomerID or CustomerName, CustomerAddress) will be the key. You can get them via:
select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'my_table_name'