#1 2017-04-06 12:23:10

stephie22
Member
Registered: 2017-03-09

COmputed Columns

Good Day, I just want to know, how does the computed column logic work? I have previously used SQL syntax in there, but keep getting an error that says cant tokenize. I tried to use the following SQL:

case  when ([Delivery date] =  '19700101' or  [Delivery date] =  '19000101')  then CAST([Action date] AS DATE) when [Delivery date] < [Action date] and ([Action date] not like '1970%' or [Action date] not like '1900%') then CAST([Action date] AS DATE) else CAST([Delivery date] AS DATE) end as "Calc Delivery"

As far as I understand, the columns used in the statement, must be a valid column in the report

Offline

#2 2017-04-06 12:44:12

eduardo
Administrator
Registered: 2016-11-01
Website

Re: COmputed Columns

Hi stephie22,

You have to put in the whitelist the expressions you want to be able to tokenize.
https://reportserver.net/en/guides/conf … mic-Lists/
https://reportserver.net/en/guides/conf … dcolumncf/

E.g.: Add:
<function>cast</function>
<function>[</function>
<function>]</function>
to the configuration file dynamiclists/computedcolumn.cf

Then you have to restart reportserver to load the configuration or write "config reload" in the terminal (if you have EE)

Regards,
Eduardo

Offline

#3 2017-04-06 12:46:37

eduardo
Administrator
Registered: 2016-11-01
Website

Re: COmputed Columns

Hi stephie22,

be careful to not to add "too much" to the whitelist in order to avoid sql injection. The whitelist is there in order to prevent sql injection and give you the control of which functions are allowed.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB