使用参数字段保护 Crystal Reports 和验证参数字段
是否可以将密码设置为水晶报表中的参数字段,或者是否可以对水晶报表的参数字段应用验证,例如,如果用户输入错误的参数,则报表退出?
Can a password be set as parameter field in a Crystal Report , OR, could Validations be applied on a parameter field of a Crystal Report, like , if the user enters the wrong parameter , then the report quits?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法使报表退出/退出,但如果参数不正确,您绝对可以隐藏报表中的详细信息/组/记录。
如果他们使用水晶报表,他们可以打开报表并删除您的“密码保护”,但是,如果报表在某种类型的查看器中运行,您可以执行一些伪保护。
您要做的就是创建一个名为 {?Password} 的参数。然后,在当前的记录选择中,输入:
此逻辑的工作方式与任何其他 SQL 逻辑类似,查询必须为 true 才能返回记录。在上述情况下,如果密码不匹配,则查询为 false。
这将阻止任何记录出现。
或者,您可以基于类似的逻辑隐藏/抑制部分,甚至在密码错误时显示部分(如果密码正确则隐藏它)。在此逻辑中,如果密码错误,您可以格式化一个部分以显示“输入的密码无效”。
有道理吗?
You can't make the report quit/exit, but you can definitely hide details/groups/records in a report if the parameter is incorrect.
If they are using Crystal Reports, they can open the report and remove your "password protection", but yes, you can do some pseudo protection if the report is being run in a viewer of some type.
All you would do is create a parameter called {?Password}. Then, within your current record selection, put:
This logic works like any other SQL logic in that the query must be true to return records. In the case above, if the password does not match, the query is false.
That would keep any records from showing up.
Alternatively, you can hide/suppress sections based on similar logic or even show a section if the password is wrong (and hide it if it's right). Within this logic, you could format a section to show "Invalid Password Entered" if the password is wrong.
Make sense?