Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 How to get columns from row values

Author  Topic 

sqlbug
Posting Yak Master

201 Posts

Posted - 2010-04-15 : 16:43:55
I need to do this report based on this stored procedure:
SELECT Z.ZONE_OWNER, Z.ZONE_NAME, COUNT(PLOT_ID) TOTAL_PLOTS, Z.ZONE_ID, SI.PLOT_NAME, SI.COLLECTION_MONTH, SI.DELAYED_BY, SI.SITE_ID
FROM ZONE_INFO Z
INNER JOIN ZONE_STATION_XREF ZSX ON Z.ZONE_ID = ZSX.ZONE_ID
INNER JOIN STATION_INFO STN ON STN.STN_ID = ZSX.STATION_ID
INNER JOIN SUBMIT_INFO SI ON SI.SITE_ID = Z.ZONE_ID
...................

The report should look like following:
--------------------------------------------------------
+ Zone Owner Zone ID Zone Name Total Plots
--------------------------------------------------------
(four fields displayed in a row with a plus on the left)

When the plus is clicked (for each Zone) - it should open up a second table looking like:

----------------------------------------------------------------------
Plot Name Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
----------------------------------------------------------------------

Values for each month will come from the "Delayed_By" field (corresponding to the value of "Collection_Month" field where the values for each row is like January/February/March...etc.)

Currently I have it using asp .net gridview. And I want to do it using a ReportViewer control on a asp .net page.
Is it possible at all? I know little bit of reporting, so need help.
Thanks.
   

- Advertisement -