Can SSRS Show Multiple Views (Charts, Cross Tabs, whatever) Of the Same Temporay Table Data Source
What I am tryingh to do is to first determine if SSRS can do this and if it can then how. I want to avoid invetsing a lot of time in trying to create an SSRS report only to then discover its not possible to do this in SSRS. I am trying to convert over to a report the query results I get now using the SSMS Query Tool. Currenlty I populate a Temp table (#MYTEMPRESULTS) with a large set of data and then query that temporay table numerous times in various ways to get several different views of the data like this: /*Step 1 - Create Temp Table*/ SELECT T.MyKeyCol, T.dPrice, T.sDesc, T.Category1, T.Categroy2, T.Region, T.SalesPerson INTO #MYTEMPRESULTS FROM MYTABLE T WHERE 1 = 1 /*Step2 - Query Temp Table Several Times to Get varying levels of aggregation from the data*/ /*Query 1 - High level Count*/ SELECT Count(X.MyKeyCol), T.Category1 FROM #MYTEMPRESULTS X WHERE T.Category1 IN('CriteiraValue1','CriteiraValue2','CriteiraValueN') GROUP BY T.sCategory1 /*Query 2 - High level Summary*/ SELECT Sum(X.dPrice), T.Category1 FROM #MYTEMPRESULTS X WHERE 1 = 1 GROUP BY T.sCategory1 /*Query 3 - Low level COunt By Salesperson*/ SELECT Sum(X.dPrice), Count(X.MyKeyCol), T.SalesPerson FROM #MYTEMPRESULTS X WHERE X.Region IN('RegionValue1','RegionValue2','RegionValueN') GROUP BY T.SalesPerson I do this instead of querying the source tables each and every time so as to cut down on unnecessary trips thru the query engine. Each query is for the same data but in different views our outputs and so a temporary table is an ideal choice ini terms of performance. Does SSRS support creating a temp table and then querying it multiple times either for a cross tab or a chart or just a simple matrix or table like output? Thanks
June 19th, 2012 2:19pm

Hi There, You can certainly achieve this in SSRS and that is without even using Temporary Tables. Consider using Data Region Filters. Here is how you can do this: Create a Dataset with your first query as shown below SELECT T.MyKeyCol, T.dPrice, T.sDesc, T.Category1, T.Categroy2, T.Region, T.SalesPerson FROM MYTABLE TUse this dataset in the Data Regions and add appropriate filters on the Data Regions (as presented in your 1st, 2nd, and 3rd queries) instead of Dataset itself. With this you can have one single Dataset (meaning you query the database only once) and use it in any of the Data Regions in the report. Refer to these articles for details on Data Region Filters and how to add them: http://msdn.microsoft.com/en-us/library/dd239395.aspxhttp://msdn.microsoft.com/en-us/library/ms156270(v=sql.100).aspx Best Regards, Datta ---------------------------------------------------------------------------------------------------- Dattatrey Sindol My Blog: Datta's Ramblings on Business Intelligence 'N' Life The information provided here is "AS IS" with no warranties, and confers no rights. Please mark the post as answered if it solves your problem.
Free Windows Admin Tool Kit Click here and download it now
June 19th, 2012 3:39pm

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

Other recent topics Other recent topics