vb.net - Crystal Reports 除以零,但有问题仅检查零以突出显示零
问题描述
嗨,我正在尝试完成一份水晶报告,摘要报告,但我得到了零错误除法。我已经查找了所有内容,但没有一个选项对我有帮助。已经存在的选项只会使我的数学公式将所有内容都归零。
if 1-({@dspStkWip}+{tblItem.OnOrderQuantity}/{@dspNeed})*100 > .15
then crYellow
else CrNocolor;
那么发生了什么,因为列中的需要为零,它最终会使所有内容都为 0。我只需要找到一种方法来实现零检查并查看它是否需要在列中突出显示。
解决方案
{@dspNeed} 字段对我来说似乎是罪魁祸首。如果此字段包含 0 或 NULL 值,那么您将得到您描述的除以零错误。
尝试这个:
IF {@dspNeed} <> 0 THEN
if 1-({@dspStkWip}+{tblItem.OnOrderQuantity}/{@dspNeed})*100 > .15
then crYellow
else CrNocolor
ELSE
\\ code for how to handle values that throw division by zero error goes here
推荐阅读
- python - 加入服务器时在用户昵称前添加氏族标签 discord.py
- volttron - 带有 CRON 的 volttron 调度执行器代理
- php - (已解决)PHP DOMDocument 获取tbody下的全部内容
- python - 如何解决显示 AttributeError: 'Pandas' object has no attribute 'Password' 的问题?
- javascript - Discord Bot TypeError:无法读取未定义的属性“id”
- python - 如何在 discord.py 中循环播放音乐?
- java - 错误:PostgreSQL 中没有参数 $1
- angular - 故事书:在 Angular 项目中隐藏“显示代码”按钮
- ios - UIImagePickerControllerDelegate 未被调用,所选图像从未显示
- javascript - htmlparser2 - 替换 html 字符串中所有 href 属性的值