Hi, I was curious about setting a parameter value using a Data Item. I have a report that I have created a Data Item that uses a CASE WHEN condition to try and set the value of ?myParam? parameter. Then a Filter set on [My Field] > ?myParam? for example. This is an optional filter so if the CASE WHEN doesn't assign a value to the parameter then the filter will not apply. It appears that its never assigning the value to the parameter. Here is an example of the Data Item Expression that is supposed to set the parameter value:
CASE
WHEN (?Param1? = 'X') THEN (NULL)
WHEN (?Param1? = 'Y') THEN (?myParam? = 45)
ELSE (NULL)
END
The optional filter is:
[myField] > ?myParam?
Set Parameter Value with Data Item
-
- Premium Member
- Posts: 145
- Joined: Thu Oct 26, 2017 10:43 am
A job can not modify its own parameters. They are set when the job begins executing. The usual technique is to use a separate job/routine/command to derive the required parameters and then pass them to the job that needs them.
There should be lots of discussion about the various techniques. Since you're using a server job, the user status property is very handy.
Mike
There should be lots of discussion about the various techniques. Since you're using a server job, the user status property is very handy.
Mike
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 145
- Joined: Thu Oct 26, 2017 10:43 am
-
- Premium Member
- Posts: 145
- Joined: Thu Oct 26, 2017 10:43 am
I did in fact get a work around for this functioning. Basically I have a report that has a prompt to run one of a selection of report pages. The report pages use the same query but with different filters. In this case I made a report to use flag, then made the report requirements (Balance < X for report 1, and Days OD > Y for report 2) a flag as well. Each row then has a flag for which report it belongs in and these are concatenated as rows can belong to one or both reports. Then the filter is set to only show rows that have their report selected flag value in the report belongs to flag. These flags are all hidden from the report output of course.
-Me