#1 2015-10-30 10:26:10

ralex
Member
Registered: 2015-04-20

default value for text parameter defined as string

Hi,
I would like to know why does reportserver set a blank value if the text parameter, defined as a java string, is left empty instead of null value?

Another question is : How can I force reportserver by sending null value if the string parameter is left empty?

Thanks,

Cheers,

Alex

Offline

#2 2015-10-30 18:43:09

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: default value for text parameter defined as string

Hi,

I am afraid there is currently no easy way of doing this. The default is that for a text parameter that is a string an empty string is forwarded as an empty string rather than NULL. While for other datatypes (e.g., Integers) an empty string is NULL. You could hack ReportServer here and, for example, adapt parameters on report execution, but there is no clean way of doing this. The best way would probably to have this configurable in the parameter settings.

Cheers
Arno

Offline

#3 2015-10-31 07:02:20

ralex
Member
Registered: 2015-04-20

Re: default value for text parameter defined as string

About the Integer, I have been noticing that I cannot leave an empty value, if the text parameter is an integer data type.
As soon as I ve been trying to run the preview, reportserves shows up a red symbol, like a warning, because it wants a value.
Since we have reports with text parameter , as integer, but they can be empty before running. How can I workaround this?
Thanks again,
Cheers,
Alex

Offline

#4 2018-12-10 17:52:25

eduardo
Administrator
Registered: 2016-11-01
Website

Re: default value for text parameter defined as string

Hi ralex,

for completeness:
we added an option for text parameters: "return null on empty"  (RS-1953). This will be available in reportserver 3.0.6, available by the end of the year.

For integers and other data types, we return null if they are left empty. Only if the "mandatory" option is set, the user gets an error if the parameter value is empty.

Regards,
Eduardo

Offline

#5 2019-03-13 10:40:29

eduardo
Administrator
Registered: 2016-11-01
Website

Re: default value for text parameter defined as string

Hi ralex,

ReportServer 3.0.6 is released and this is available now as you can read in the release notes: https://reportserver.net/releasenotes/RS3.0.6.html

RS-1953    New Feature    Extend text parameters to allow for NULL return on empty strings

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB