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

Notification

Icon
Error

Options
Go to last post Go to first unread
barrosw  
#1 Posted : Wednesday, April 19, 2017 2:21:20 PM(UTC)
barrosw

Rank: Newbie

Groups: Registered
Joined: 2/1/2017(UTC)
Posts: 2
Portugal
Location: Lisbon

Thanks: 1 times
Hello,

I've started using Seal Report a couple days ago and I'm trying to figure out how can I define input parameters to be used as a filter in the SQL statement for my main table.

Here you have an example:

Select * from myTable where myTable.Col1 = @myParam;

Can anyone help me to understand how can I set the variable @myParam to be passed by the user before executing the query?

Thanks in advance.

Best regards.
epf  
#2 Posted : Thursday, April 20, 2017 9:30:15 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 387
Switzerland

Thanks: 6 times
Was thanked: 51 time(s) in 50 post(s)
The trick is to set a restriction in your model (from any element),
you can change his name
then you use the Operator: Value Only
and in advanced option, you set the flag Use As Parameter

You can check the samples '51' and '52'

Then you can use the value for any purpose in scripts....
e.g. you can add a dynamic restriction in tables, but you have to understand how reports are built.

Check also the post http://forum.sealreport.org/default.aspx?g=posts&t=278#post630
thanks 1 user thanked epf for this useful post.
barrosw on 4/24/2017(UTC)
barrosw  
#3 Posted : Monday, April 24, 2017 4:50:00 PM(UTC)
barrosw

Rank: Newbie

Groups: Registered
Joined: 2/1/2017(UTC)
Posts: 2
Portugal
Location: Lisbon

Thanks: 1 times
Originally Posted by: epf Go to Quoted Post
The trick is to set a restriction in your model (from any element),
you can change his name
then you use the Operator: Value Only
and in advanced option, you set the flag Use As Parameter

You can check the samples '51' and '52'

Then you can use the value for any purpose in scripts....
e.g. you can add a dynamic restriction in tables, but you have to understand how reports are built.

Check also the post http://forum.sealreport.org/default.aspx?g=posts&t=278#post630



Thank you for helping. It worked perfectly!

By the way, I am facing almost the same case but with a DrillDown list based on a Enum.

Should I use it the same way that I did for the other types of input parameters?

I am asking because once I create the restriction based on a Enum List, the output of my view has 2 keys with the same name: one with the Enum List and another one(with the same key) as a input text.

Here is the properties that I've set for the mentioned restriction:

Name : MyRestriction
Operator : Value only
Prompt restriction : Prompt only one value
Is required : True

Data type : Default
Custom Enumerated List : MyEnumList
Use as parameter : true

Am I missing something?

Thank you!

Best regards,

William.


epf  
#4 Posted : Monday, May 01, 2017 8:35:30 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 387
Switzerland

Thanks: 6 times
Was thanked: 51 time(s) in 50 post(s)
I do not understand your problem,
Check the sample 52: it uses a custom enum list as parameter.
You can use either key value or display value of the enum selected depending on your needs.
Users browsing this topic
Guest (2)
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.

Powered by YAF 2.0.0 | YAF © 2003-2017, Yet Another Forum.NET
This page was generated in 0.083 seconds.