报表查看器表达式 [英] Report Viewer Expressions

查看:78
本文介绍了报表查看器表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试修改RDLC文件中的表达式以获取列值。我似乎找不到很多如何一起使用2个表达式的例子,或者我不理解表达式语法



所以我有一个名为FPROFIT的列我正在使用表达式对话框编辑器。

第1行说明了我理解的数据集中的值。

但是我想改变文本的颜色如果值为负,则为红色。

I'm trying to modify an expression in the RDLC file for a column value. I can't seem to find many examples of how to use 2 expressions together, or I'm not understanding the expression syntax

So I have a column called FPROFIT and I'm using the expression dialog editor.
Line 1 says to state the value from my dataset in which I understand.
But I want to change the color of the text to red if the value is negative.

=Fields!FPROFIT.Value



所以这是给出的示例它


So this is the example give for it

=IIf(Fields!FPROFIT.Value <=100, "Red", "Black")



我想用于第1行和第2行,还是将它们组合在一起?


Am I suppose to use to lines, line 1 and line 2, or combine them together?

推荐答案

我假设您正在查看TechNet上的文档?

http://technet.microsoft.com /en-us/library/ms156400%28v=sql.100%29.aspx [ ^ ]



您的第一个表达式需要设置为TextBox。第二个表达式需要根据TextBox的Color属性设置。



你需要:

I assume you're looking at the documentation on TechNet?
http://technet.microsoft.com/en-us/library/ms156400%28v=sql.100%29.aspx[^]

Your first expression needs to be set as the text of the TextBox. The second expression needs to be set against the Color property of the TextBox.

You need to:
  1. 点击在您要修改的报表项上;
  2. 打开属性窗格(如果它不可见);
  3. 在属性窗口中选择Color属性;
  4. 在下拉列表中,选择 Expression ... 选项;
  5. 输入 IIF(.. 。)表达式在编辑表达式框中;
  1. click on the report item you want to modify;
  2. open the properties pane (if it isn't visible);
  3. select the "Color" property in the properties window;
  4. in the drop-down, select the Expression... option;
  5. enter your IIF(...) expression in the "Edit Expression" box;


这篇关于报表查看器表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆