We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

query with blank parameter value

Thread ID:

Created:

Updated:

Platform:

Replies:

129967 Apr 12,2017 06:42 AM May 19,2017 01:52 AM Report Platform 5
loading
Tags: Report Designer
Gregory Kohle
Asked On April 12, 2017 06:42 AM

Hi,

I tried using a parameter, which can be blank in a query.
There are only values displayed if I put in a value for the parameter.
Here is the query:

select distinct Partnum from Artikel
where PARTNUM like '%' + @SearchArticle + '%'

Do I have to do something else to get it working or should this work?
Thanks.

Regards,
Patrick

Vijay Raja [Syncfusion]
Replied On April 13, 2017 10:10 AM

Hi Ptrick, 

Thanks for your interest in Syncfusion components. 

The provided query will return the data only for non-null inputs, you can use the OR SQL Logical operator to return data for null type values inputs as shown in the below query. 

SQL query: 
select distinct Partnum from Artikel where PARTNUM like '%' + @SearchArticle + '%' OR ( (@SearchArticle is NUll) AND (PARTNUM is NULL) ) 

Regards, 
Vijay R. 


Gregory Kohle
Replied On May 17, 2017 05:35 AM

Hi Vijay,

I want to show all values when the parameter is blank and if there is a text then filter depending on that.
I noticed that if I enter some data and then make this field blank again then there is the outcome I wanted.
If i just leave the field ontouched then there is no data to be loaded.
I attached the report and a test database.
Thanks.

Regards,
Patrick

Attachment: ReportBlankSearch_38dcbf56.zip

Vinoth Srinivasan [Syncfusion]
Replied On May 18, 2017 07:04 AM

Hi Patrick, 
 
The ReportParameter “SearchArticle” set to “Allow Blank Value”, so the empty sting value passed to the query and it fails in returning data. We request to enable the “Allow Null Value”, “Allow Blank Value” for the “SearchArticle” parameter to retrieve data at initial loading. We have modified your report based on this and it can be downloaded from the following location. 
 
 
Regards, 
Vinoth S. 


Gregory Kohle
Replied On May 18, 2017 07:25 AM

Hi Vinoth,

got it working now.
Thanks.

Regards,
Patrick

Vinoth Srinivasan [Syncfusion]
Replied On May 19, 2017 01:52 AM

Hi Patrick, 

Thanks for your update. We are happy to hear that your query is resolved. Please let us know if you require any further assistance on this. 

Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;