Hi,
I know the use of cascading parameters when you use queries in your dataset.
But could somebody explain to me how to use them when using a reportmodel ?
Vinnie
Ok,
So after long research and testing and testing and test......
i have finaly found the solution.
In order to use cascading parameters with datasets based on models this is how you proceed.
Use the same filtersettings in your datasets that you want to limit to a previous dataset. (ok, i know this sounds like sh...)
but i will explain with an example.
supose you have in your dataset based on an entity with various fields like datetime, userid, username, ...
the goal is to make a report that will let me select a time period (from ... to ...) and will let me select one or more agents that
worked during that period.
This is how i do that :
Create a first dataset based on an entity (eg: UserData). Select the fields you want to show into the report.
Next specify the filters you want to apply to the report.
First we will define your start and end date :
drag your datetime field into the filter area (this will be your start date) and drag the same field back again in the filter area
(this will be your end date). click on the first filter (equals) and change it to 'on or after'. Do this also for the second filter and
change it into 'on or before'. Then click on both of the filters and click on 'prompt'. (this is to indicate to the program that it has
to prompt you to fill in the parameter. Click ok to confirm these filters and go to report parameters menu. Normaly there should
be two parameters created (DateTime and DateTime1 or something like that). Change the type to a datetime of both the
params. You can also change the label if needed.
So you run the report now, you will be first prompted to set a start and an end date.
Now to setup a third parameter (i want a list of the users who worked during that period i indicated with my start and end
date)
Open the first dataset, go to filters and drag and drop the userID (or wathever) entity into the filters. Make it again so it prompts
you for an input. Change "equals" into "in a list".(this is to be able to select more then one user)
Create a second dataset based on the same entity. Select UserId and UserName as fields you want to use in that dataset.
Go to filters and do the same action with the datetime field as you did in dataset1.
"
drag your datetime field into the filter area (this will be your start date) and drag the same field back again in the filter area
(this will be your end date). click on the first filter (equals) and change it to 'on or after'. Do this also for the second filter and
change it into 'on or before'. Then click on both of the filters and click on 'prompt'. (this is to indicate to the program that it has
to prompt you to fill in the parameter. Click ok to confirm these filters
"
Now go again to report parameters menu. A third parameter will be created (Userid). Select this parameter. It will be defined
as a string. check the multi value option. In the available values select from query. select "dataset2" (or whatever you named
it). select userid as value field and username as label field..
Now, when you run the report, and you input the start and end date, your user selection will be limited to your selected time
period (this can be seen because it will take a few moments to populate the user selection listbox).
I know this is a long explanation but i hope it is clear. After all the solution was simple, but i didn't find the answer.
Greetings
Vinnie
No comments:
Post a Comment