Showing posts with label choice. Show all posts
Showing posts with label choice. Show all posts

Thursday, March 22, 2012

Dynamic Parameters

Iam programatically passing parameters to the rdl file, Right now I have four parameters but if I want to have a choice of giveing only 2 or more that 6 parameters then do I need to have a different RDl files one with 2 parameters & another with 6 parameters.
I dont think it is feasible.
Even I should have the flexibility to add or remove the number of parameters dynamically. is ther any wayhow can I sole this situation.

Example: Iam displaying employee table of AdventureWorks database where Iam passing
Parameter 1.DepartmentId
Parameter 2.Title
and for Hiredate
iam passing i.e
Parameter 3. startdate &
Parameter 4.enddate

now that I have to give all the values in parameters to view the report if I want to all the employees in deptid = 5 having Title="Buyer" but not restricting them with date then it is not possible.

I hope the Above situation is clear please feel free if U have any queries.

HELP ME Dude's

Regards

You could assign default values to all 6 parameters at report design time. If a parameter value isn't specified at runtime the default value will be used instead. Just write your SQL query to take the default values into account and not use the param as a filter value - it generally looks like (@.Title = TableName.Title OR @. Title IS NULL) AND ...
The one caveat is that default values can sometimes throw off the optimizer and make for long running queries.

Sunday, February 19, 2012

Dynamic columns in report

In RS2005, is it possible to add / remove report columns dynamically. I

mean the user will have choice to see which columns he wants to see in the

report. Depending on his selection, the report will be rendered.

Is this possible?

TIA,
Tan

YOu will have to use Report Builder for that, there is a sample within the reporting server samples and explanations in the BOL.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Another way to accomplish this is to create a report parameter with each column name as a value. Then set the visibility of each column to whether or not the user selected the value in the parameter.

For example, let's say you have a table with 3 columns - city, state, and zipcode

First, create a parameter called columnChoice set as multivalued and values from non-query. Enter in the name of the column as both the value and the label.

Then, select the city column from your table. Be sure to click the grey bar above the column as opposed to just clicking individual cells. Set the visibility -> hidden property to:

=Iif(InStr(Join(Parameters!columnChoice.value), "city"), false, true)

You can then apply this same format to each of the columns in the table. You now have a report where the user can determine which rows to show and which to hide.

Good luck!!

|||

Thanks a lot,

It solved my issue.

Tanmaya

Dynamic columns in report

hi,
In RS2005, is it possible to add / remove report columns dynamically. I mean
the user will have choice to see which columns he wants to see in the
report. Depending on his selection, the report will be rendered.
Is this possible?
TIA,
TanThe only way I know of doing this is by using a matrix and generating your
dataset in a stored procedure producing the columns that you need.
HTH,
Magendo_man
"Tanmaya Kulkarni" wrote:
> hi,
> In RS2005, is it possible to add / remove report columns dynamically. I mean
> the user will have choice to see which columns he wants to see in the
> report. Depending on his selection, the report will be rendered.
> Is this possible?
> TIA,
> Tan
>
>