RDLC Expression counting all rows where value is True -


i need count values "true", have 2 datasets. saw lot of tutorials 1 dataset , seems easy because thay can name value , works. thing tried

=count(iif((fields!usvojena.value, "datasettackednevnogreda") = "true", 1, nothing)) 
  • fields!usvojena.value returns true or false
  • "datasettackednevnogreda" name of second dataset

i error message:

the value expression textrun ‘textbox8.paragraphs[0].textruns[0]’ has scope parameter not valid aggregate function. scope parameter must set string constant equal either name of containing group, name of containing data region, or name of dataset.

also reason fields!usvojena.value underlined red color in expression windows

you can use sum instead of count eliminate including "nothing" value (and count anyway) - add 1 have fields!usvojena.value = true , 0 if it's not. also, if field boolean true/false, can way:

=sum(iif(fields!usvojena.value, 1, 0)) 

if field string "true" or "false" values, need add value comparison:

=sum(iif(fields!usvojena.value = "true", 1, 0)) 

as underlying red color - check field name well.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -