Multiple Parameter ????
-
- Posts: 7
- Joined: Mon May 18, 2009 12:17 am
- Location: Hyderabad
Multiple Parameter ????
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 .
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 ????
Hello,
You need change your sql query regarding your request because query:
returns only rows where Companyid is null. You need use something like this:
Thank you.
You need change your sql query regarding your request because query:
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and Companyid = null
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and (Companyid = @CompanyID or @CompanyID is null)
-
- Posts: 7
- Joined: Mon May 18, 2009 12:17 am
- Location: Hyderabad
Multiple Parameter ????
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
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 ????
Hello Karthik,
select * from customers where {myvariable}
but i recommend you use variant which i post in previous topic.
Thank you.
In this case you need change your sql query. You can try use expression in sql query. For example: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.
select * from customers where {myvariable}
but i recommend you use variant which i post in previous topic.
Thank you.
-
- Posts: 7
- Joined: Mon May 18, 2009 12:17 am
- Location: Hyderabad
Multiple Parameter ????
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 ????
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 ????
Hello,
You have tryed following variant?
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.
You have tryed following variant?
Code: Select all
Select * from DatabaseName where username = @USERNAME1 and (CompanyID = @CompanyID or @CompanyID is null)
Thank you.
-
- Posts: 7
- Joined: Mon May 18, 2009 12:17 am
- Location: Hyderabad
Multiple Parameter ????
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.
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 ????
Multiple Parameter ????
hai im using stimulsoft tool . i passed multiple parameters in single variable . example variablename is firstname parameter values (dinesh,kumar,thiru,etc)
hai im using stimulsoft tool . i passed multiple parameters in single variable . example variablename is firstname parameter values (dinesh,kumar,thiru,etc)
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Multiple Parameter ????
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.