Crystal Reports V11 显示每台机器的不同布尔值
我在 Crystal 方面遇到了一个奇怪的问题 - 我有一个基本报告,它显示依赖于布尔值(“开放”)是否为真的记录。然而,在某些电脑上它工作正常,在其他电脑上它只显示显示空白报告。
对此进行了一些检查后,查看 SQL 查询似乎表明 Crystal 在不同机器上解释布尔值的方式存在问题。
如果我们在每台机器上选择“显示 SQL 查询”,则不起作用的机器将布尔部分显示为:
`support`.`open`=1
起作用的机器显示:
`support`.`open`=.T.
...这似乎更现实,因为数据源是通过 VFP 表ODBC 驱动程序。
我不太明白这个问题 - 我想这可能与 ODBC 驱动程序有关。有人知道为什么会发生这种情况吗?
谢谢
I'm getting a weird issue with Crystal - I have a basic report that displays records dependant on a boolean value ('open') being true. However, on some PCs it works fine, on others it just shows displays a blank report.
Having done a bit of checking into this, viewing the SQL query seems to indicate that there's an issue with how Crystal is interpreting the boolean value on different machines.
If we select 'Show SQL query' on each of the machines, the ones that don't work show the boolean section as:
`support`.`open`=1
The ones that work show:
`support`.`open`=.T.
...which seems more realistic due to the datasource being a VFP table via an ODBC driver.
I can't quite figure this one out - I suppose it's possible it's something to do with the ODBC driver. Does anybody have any clues as to why this might be happening?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
布尔值应该通过 ODBC 直接解释...我会将查询更改为只有
Where 'support.open'
如果符合逻辑,它只会是.T。 /.F.或 true / false 或 1 / 0...让 ODBC 处理程序为您处理。
--- 通过评论进行编辑。
我不是指 Crystal 的报告公式,而是查询...但如果这就是 Crystal 中的问题,我会将检索数据的查询更改为...
IIF( support.open, "YES", " NO " ) as ItemIsOpen
VFP OleDB / ODBC 应识别 IIF() 并将列分别返回为“YES”或“NO”字符串...然后在报告中使用“ItemIsOpen”列而不是“support.NO”列。打开”专栏。
The boolean should be directly interpreted through the ODBC... I would change the query to just have
Where 'support.open'
If logical, it will only be .T. / .F. or true / false or 1 / 0... Let the ODBC handler handle it for you.
--- Edit via comment.
I wasn't referring to Crystal's report formula, but the query... But if thats the issue in Crystal, I would change the query that is RETRIEVING the data to be...
IIF( support.open, "YES", "NO " ) as ItemIsOpen
VFP OleDB / ODBC should recognize the IIF() and return the column to a string of "YES" or "NO " respectively... Then use the "ItemIsOpen" column in your report instead of the "support.open" column.