sql server - Set local variable in rdlc expression -


is possible somehow create variable in rdlc report expression in 'online' manner?

for example, have following expression:

=iif(first(fields!billingaccount_billtostateprovince.value, "invoice") <> "",  first(fields!billingaccount_billtostateprovince.value, "invoice") + " ",  "") 

i suppose i'm evaluating following expression first(fields!billingaccount_billtostateprovince.value, "invoice") twice. don't , looks ugly... prefer create variable in scope of current expression , use it.

is possible?

as user3056839 said, welcome ssrs!

anyway, want not possible since writing right not script it's expression. it's single statement returns value, cannot declare variables, use loops or part of script.

you have use writing.

also it's not rare see iif expression yours. 1 see iff( not null, , 'n/a'). field may evaluated twice, there's nothing can do. it's ugly it's way can that.

just think case when clause:

select  case when myfield not null    myfield else 0 end 

you evaluating field twice, there's nothing can :)


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -