Page 1 of 1
Multiple Parameter ????
Posted: Mon May 18, 2009 12:29 am
by Karthikeyan.V
Hello,
I have 2parameters to Filter the Compiled report.
Dim Stimulrep As StiReport = New StiReport()
Stimulrep("@USERNAME1") = objuserInfo("userName")
Stimulrep("@CompanyID") = ddlCompanyName.SelectedItem.Value
Not everytime i may not pass value in all 2 of parameter's. i tried to pass values like the following lines
Stimulrep("@USERNAME1") = objuserInfo("userName")
Stimulrep("@CompanyID") = Nothing
But the Report is coming Empty.if I pass both parameter is passed then the report is working. what can be done to bring result even if only one parameter is passed at a time.
The Edit Data Source Query iam using is Select * from DatabaseName where username = @USERNAME1 and Companyid = @CompanyID.
Please Help me in fixing this issue. Thanks In Advance .
Multiple Parameter ????
Posted: Mon May 18, 2009 3:09 am
by Jan
Hello,
You need change your sql query regarding your request because query:
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and Companyid = null
returns only rows where Companyid is null. You need use something like this:
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and (Companyid = @CompanyID or @CompanyID is null)
Thank you.
Multiple Parameter ????
Posted: Mon May 18, 2009 5:24 am
by Karthikeyan.V
Hi,
Thanks for the response. But the company id is optional parameter here. So how to pass the optional parameter if the user is not selected anything from the company names dropdown.
regards,
karthik
Multiple Parameter ????
Posted: Mon May 18, 2009 12:38 pm
by Jan
Hello Karthik,
karthik_saje wrote:Hi,
Thanks for the response. But the company id is optional parameter here. So how to pass the optional parameter if the user is not selected anything from the company names dropdown.
In this case you need change your sql query. You can try use expression in sql query. For example:
select * from customers where {myvariable}
but i recommend you use variant which i post in previous topic.
Thank you.
Multiple Parameter ????
Posted: Tue May 19, 2009 4:04 am
by Karthikeyan.V
Hello,
Just a last question, if i have 2 parameters say @CompanyID and @DepartmentID
How should i write the SQL Query in Stimulsoft EDIT Datasource. i mean i have value of only CompanyID and Department is NULL. I had tried many possiblities but still the report comes empty. if i pass values for both parameter the Report works. Please Suggest us what can be done. i read from post that We can use variable instead of parameter . is that correct ????
Multiple Parameter ????
Posted: Mon May 25, 2009 1:57 am
by Jan
Hello,
You have tryed following variant?
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and (CompanyID = @CompanyID or @CompanyID is null)
If you specify parameters in your report you need fill it with value which will give you result. If you don't want specify parameter value you need change sql query or you need add logic construction which will be support parameter with null value. Please check query which i post before.
Thank you.
Multiple Parameter ????
Posted: Tue May 26, 2009 5:10 am
by Karthikeyan.V
Hello,
Thanks for your speedy reply,
i used Query like this
Select * from DatabaseName where username = @USERNAME1 and (CompanyID = @CompanyID or @CompanyID ='')
and this helped me in getting my output. thanks again.
Re: Multiple Parameter ????
Posted: Sat Jul 04, 2020 2:00 am
by thiru
Multiple Parameter ????
hai im using stimulsoft tool . i passed multiple parameters in single variable . example variablename is firstname parameter values (dinesh,kumar,thiru,etc)
Re: Multiple Parameter ????
Posted: Mon Jul 06, 2020 5:34 pm
by Lech Kulikowski
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.