Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services #在表达式中添加和时SSRS中的错误处理_Reporting Services_Ssrs 2008 - Fatal编程技术网

Reporting services #在表达式中添加和时SSRS中的错误处理

Reporting services #在表达式中添加和时SSRS中的错误处理,reporting-services,ssrs-2008,Reporting Services,Ssrs 2008,我正在编写一份报告,其中一个领域是 =(ReportItems!Textbox1.value ReportItems!Textbox2.value) /(ReportItems!Textbox1.value+ReportItems!Textbox2.value) 这是前两个字段的除法,如果这些字段有任何值,则得到正确的值,但如果前两个字段没有任何值,则表示如果它们为空,则返回错误 最后我使用了下面的VB.Net代码 公共共享函数VarPercent(ByVal实际为十进制,ByVal预算为十进制

我正在编写一份报告,其中一个领域是

=(ReportItems!Textbox1.value ReportItems!Textbox2.value) /(ReportItems!Textbox1.value+ReportItems!Textbox2.value)

这是前两个字段的除法,如果这些字段有任何值,则得到正确的值,但如果前两个字段没有任何值,则表示如果它们为空,则返回错误

最后我使用了下面的VB.Net代码

公共共享函数VarPercent(ByVal实际为十进制,ByVal预算为十进制)为十进制 如果预算=0,则 返回0 如果结束 回报(实际/预算) 结束功能

使用下面的表达式

=code.varpercent(ReportItems!Textbox1.value ReportItems!Textbox2.value) /(ReportItems!Textbox1.value+ReportItems!Textbox2.value)它工作得很好

看,我的问题是当我尝试添加如下字段的总和时

=code.varpercent(总和(ReportItems!Textbox1.value ReportItems!Textbox2.value)) /总和((ReportItems!Textbox1.value+ReportItems!Textbox2.value))

我遇到了错误, 在表达式中添加求和函数是否正确? 如果是,如何在上述表达式中使用求和函数? 有什么替代方案吗

谢谢


Samba

尝试将值强制转换为适当的类型(…Cint(),CDbl()…)


CDbl(ReportItems!Textbox1.value)

尝试将值强制转换为适当的类型(…Cint(),CDbl())

CDbl(ReportItems!Textbox1.value)