Fastreport DBCross View
我有 DBCross 表包含字符串和整数数据
我想通过特定的方式更改行的颜色 健康)状况。
I have DBCross Table contain string and integer data
I would like to change the color of the row through specific
condition.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用DBCross组件的PrintCell事件,并检查值
,您可以看到Memo只是TfrxMemoView,因此您可以更改TfrxMemoView的任何属性,例如字体,样式和颜色。
You can use the PrintCell event of DBCross component, and check the value
as you can see Memo is just TfrxMemoView, so you can change any properties of TfrxMemoView such as font, style and color.
如果您只需要根据特定条件更改单元格的字体外观和/或背景颜色,则可以选择使用突出显示功能,这是一种更简单的选择。它位于带有“ab”和突出显示的笔的快捷图标的第二行。您可以指定条件以及希望该单元格更改为的外观和背景颜色。
但对于更复杂的操作,如多个条件等,穆罕默德的答案将是处理它们的最稳健的方法。
要根据 1 个值更改整行,您可以使用 Mohammed 代码有 2 个选项:
1。更改
为
,然后将事件分配给该行的每个单元格的 BeforePrint。
2.更改
为
If you only need to change the font appearance and/or background color of a cell based on a specific condition, you have a more simple option of using the highlight function. It is located at the 2nd line of the quick icon with "ab" and a pen with highlight. You can specify a condition and what appearance and background color you want that cell to change into.
But for more complex operation like multiple conditions and the like, the answer by Mohammed will be the most robust way to handle them.
For changing whole row based on 1 value you have 2 options using Mohammed code :
1 . Change the
to
and then assigned the event to every cell's BeforePrint for that row.
2 . Change the
to