Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dynamic changing of row grouping using vaules from parameter

Posted on 2011-03-08
5
Medium Priority
?
849 Views
Last Modified: 2012-05-11
Hi All,

I want to change the  row grouping values(in a matrix report) dynamically depending on the values of a parameter.
For EX. I Have a column grouping for category for total price in a matrix report and i have a row grouping on States . But i want to change the row grouping from states to customers depending on the value passed in the parameter. How can i do that?

- Karru
0
Comment
Question by:skarru
  • 3
  • 2
5 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 35073871
For that you need to write a SQL SP that will take that report parameter and use it inside the SQL SP to build dynamic SQL code that you execute from there.
0
 

Author Comment

by:skarru
ID: 35074008
The fields i have taken in matrix are from a sp...so my doubt is will the report accept value from another sp for the same field?
0
 
LVL 40

Expert Comment

by:lcohan
ID: 35074042
Ok, so you should modify that SP to include the new parameter and if not null build dynamic code then execute with new group by.
0
 

Author Comment

by:skarru
ID: 35075262
This is my stored procedue can you please let me know how to modify it according to group. SP.txt
0
 
LVL 40

Accepted Solution

by:
lcohan earned 1200 total points
ID: 35083231
Please see updated attached - I changed it to CREATE and added _NEW suffix to not touch existing by accident. You may need to addapt/adjust your code but this is what I was talking about and hopefully suit your needs.
sp-new.sql
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question