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. Image for the cookie policy date
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

query with blank parameter value

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

5 Replies

VR Vijay Raja Syncfusion Team April 13, 2017 02:10 PM UTC

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. 



GK Gregory Kohle May 17, 2017 09:35 AM UTC

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


VS Vinoth Srinivasan Syncfusion Team May 18, 2017 11:04 AM UTC

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. 



GK Gregory Kohle May 18, 2017 11:25 AM UTC

Hi Vinoth,

got it working now.
Thanks.

Regards,
Patrick


VS Vinoth Srinivasan Syncfusion Team May 19, 2017 05:52 AM UTC

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. 


Loader.
Up arrow icon