在ReportViewer上绑定数据 [英] Binding data on ReportViewer
问题描述
我正在使用带有ASP.NET和C#的ReportViewer开发报表.我正在使用.RDLC设计视图将数据从数据源绑定到Tablix对象.
I am developing a Report using ReportViewer with ASP.NET and C#. I'm binding data from a DataSource to a Tablix object using the .RDLC design view.
在这个Tablix里面,有一个字段必须填写来自de datasource的一个字段,或者另一个取决于表达式的字段.
Inside this Tablix, there's a field that must me filled with one field from de datasource OR another one depending of an expression.
我尝试使用的表达式是:
The expression in the field I am trying to use to achieve that is:
=IIf(IsNothing(Fields!PREMIO_CALCULADO_1.Value), Fields!PREMIO_CALCULADO_1.Value,Fields!RECUPERACAO_CALCULADA_INI_1.Value)
如果字段"PREMIO_CALCULADO_1"为空,则将其填充为"RECUPERACAO_CALCULADA_INI".我没有编译错误,但是当我执行报告时该值应该在其中,并且有一个#error标记.
If the Field "PREMIO_CALCULADO_1" is null, then fill it with "RECUPERACAO_CALCULADA_INI". I'm not having compilation errors but when I execute the report where this value should be there is an #error tag.
我在表达上做错什么了吗?
Am I doing something wrong with that expression?
非常感谢您.
推荐答案
看起来您的返回值位置错误.
It looks like you have the return values in the wrong position.
只需在IsNothing之前添加一个NOT.
Just add a NOT before IsNothing.
这篇关于在ReportViewer上绑定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!