logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
netpacket  
#1 Posted : Saturday, April 20, 2019 10:24:43 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Hi,
I have a restriction in my report let's Say for example "WorkOrderYear". This restriction is set to "Equals,Prompt at Execution & Is Required".
I need to use the same restriction in my report but with these settings "Equals,Prompt at Execution & Is Required'.
I need the report to ask once for this restriction , So the second restriction has the same name as the first one.

RTRIM(CONVERT(nvarchar(15),dbo.MyFunc_DatePart('yy',WO.TargetYear))) IN [WorkOrderYear ?] ====> This one is set to "Value only"

AND [WorkOrderYear Equals?] ====> This one is set to "Equals"


When I execute the report , It shows that a value is needed for the restriction. In fact it seems the value is just applied to the first restriction and not passed into the second one.
epf  
#2 Posted : Sunday, April 21, 2019 8:17:22 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
I checked your sample and it appears that the Operator of the restriction will be propagated to all restrictions, this is normal but has not really sense for ValueOnly.
This will be enhanced in the 5.0. The new version will also come with the CommonRestriction feature where you can add {CommonRestriction_<Name>} keyword in your SQL and define this new restrictions in your models.

You sample is not clear:
do you have 1 or 2 models ?
Why instead of
AND [WorkOrderYear Equals?] ====> This one is set to "Equals
you don't have
AND RTRIM(CONVERT(nvarchar(15),dbo.MyFunc_DatePart('yy',WO.TargetYear))) IN [WorkOrderYear ?] ====> This one is set to "Value only"
?

So there is no problem of different Operators anymore....

Edited by user Sunday, April 21, 2019 8:18:36 AM(UTC)  | Reason: Not specified

netpacket  
#3 Posted : Sunday, April 21, 2019 8:58:12 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Hi epf, thanks for your reply
Let's put it this way, I have one model that contains a restriction called WorkOrderYear. It's set to Equals.
I need my report results to have the same WO.TargetYear as the WorkOrderYear. So I set a restriction like this :
WO.TargetYear In [WorkOrderYear ?] , That is a Value only restriction.
I have both in a model a d both set to prompt at execution and value is required. The problem is at the execution of my report, I see only one restriction prompted which is correct, but the selected value is not propagated to the second restriction.
They are the same restriction in the same model but with different settings.

Edited by user Sunday, April 21, 2019 8:59:17 AM(UTC)  | Reason: Not specified

epf  
#4 Posted : Sunday, April 21, 2019 1:45:03 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
In this case, you have to set the same operator, set your 2 restrictions to 'Value Only'
Then
WO.OrderYear In [WorkOrderYear ?]
AND
WO.TargetYear In [WorkOrderYear ?]


That should work.
thanks 1 user thanked epf for this useful post.
netpacket on 4/22/2019(UTC)
netpacket  
#5 Posted : Monday, April 22, 2019 10:01:16 AM(UTC)
netpacket

Rank: Advanced Member

Groups: Registered
Joined: 12/3/2018(UTC)
Posts: 33
Man
Switzerland

Thanks: 13 times
Hi epf,
I had to set the 2 restrictions to 'Value Only' to make it work.
all the restriction in my report are set to prompt at execution , but when i execute the report , it shows the results at first and i have click the blue restriction button on top and set the desired restrictions and hit execute again. how can I make my report ask for the restriction and then execute. As you noticed i cant use the "is required" option.
epf  
#6 Posted : Tuesday, April 23, 2019 8:45:07 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
It is probably because you have set the property 'Options: Force execution' to True in your root view...
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.