views:

715

answers:

2

Hi,

I want to create a report where my report's fields should change according to my input parameter values.

eg. if i select '2 months'. there should be 2 fields in result, having month wise calculation. if select '3 weeks'. there should be 3 fileds each for each weeks calculation instead of the 2 months field.

How do I achieve this.

Please help me.

Thanks.

A: 

Maybe you could pivot your result

JSC
A: 

I'm still a beginner at SSRS, but I've heard of a few ways to handle this:

  1. To a certain extent, you're really talking about separate queries, depending on the parameters. So, use a dynamic query (build the query up as a string expression). The simplest way I saw was to use IIF in the expression to choose one or the other stored procedure based on the parameter values.
  2. To the extent that it's pretty much the same query, but you want different columns visible, then you can tie the visibility of the columns to an expression based on the parameter values.
  3. If too much of the structure of the report differs based on the parameters, then you can use multiple reports. Have one front-end report that calls on one of the other reports based on the parameter values, passing the parameter values to the other report.

I hope that helps. If you've already figured out a solution, then please tell me!

John Saunders