Rdlc 报告中的复选框

发布于 2024-09-30 06:27:35 字数 99 浏览 1 评论 0原文

我正在创建 rdlc 报告,但遇到问题,我有一些 bool 类型对象字段,现在我必须显示复选框。但我没有发现此解决方案可以在表中显示复选框。

有谁知道我如何实现那件事?

I am creating rdlc report and i have issue that i got some bool type object fields and now i have to show checkboxes. but there is nothing i found for this solution to show checkboxes in table.

Is there anyone who know that how i can implement that thing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

煮酒 2024-10-07 06:27:35

我要求复选框有背景颜色。我喜欢基于文本而不是基于图像的方法的简单性,因此我使用了流行的 Wingdings-font 方法的变体:我使用了一个带有细边框和指定背景颜色的小方形文本框,将其设置为使用粗体、无衬线字体,并使用此表达式作为文本值:

=IIf(Fields!SomeBool.Value, "X", "")

如果您仍然想要复选标记而不是 X,则可以使用 Wingdings 2 字体和此表达式:

=IIf(Fields!SomeBool.Value, Chr(80), "")

无论哪种情况,您可能都需要调整字体大小和/或框大小以保持结果正方形;我的第一个镜头是高大于宽,因为它垂直扩展以适应字体。

I had a requirement that the checkboxes have a background color. I liked the simplicity of a text-based rather than image-based approach, so I used a variation of the popular Wingdings-font method: I used a small, square textbox with a thin border and the specified background color, set it to use a bold, sans-serif font, and used this expression for the text value:

=IIf(Fields!SomeBool.Value, "X", "")

If you still want a checkmark rather than an X, you can use Wingdings 2 font and this expression:

=IIf(Fields!SomeBool.Value, Chr(80), "")

In either case, you may have to adjust the font size and/or box size to keep the result square; my first take was taller than wide because it expanded vertically to accommodate the font.

长不大的小祸害 2024-10-07 06:27:35

也许你可以把图像放在那里,取决于真或假,只是显示不同的图片。哈哈

Maybe you can put image there, depend on true or false, just display different pic. LOL

迷你仙 2024-10-07 06:27:35

如果复选框为 true,我设置 Chr(254),否则使用 Chr(168) 显示未选中的复选框。

Chr(254):这是 Wingdings 字符 254 的十进制值,它显示为选中的复选框图像。
Chr(168):这是 Wingdings 字符 168 的十进制值,它显示为矩形框,如未选中的复选框图像。

If checkbox is true I set Chr(254) else show unchecked checkbox using Chr(168).

Chr(254): This is decimal value for Wingdings character 254 its shows like checked check box image.
Chr(168): This is decimal value for Wingdings character 168 its shows like rectangle box like unchecked check box image.

无声无音无过去 2024-10-07 06:27:35

或者您可以设置文本框占位符以将标签呈现为 html,然后将此 html 放入: 或者您可以设置占位符表达式以支持 HTML,然后设置以下 html 代码:

<font face="Wingdings 2" color="green">@Html.Raw(((char)0x51).ToString())</font>

您应该放入您想要的 wingdings 的字符。
这样,只有部分文本可以是 wingdings。
Wingdings 2

Or you can set the textbox placeholder to render tags as html and then put this html in: Or you can set the Placeholder expression to support HTML and then set up the following html code:

<font face="Wingdings 2" color="green">@Html.Raw(((char)0x51).ToString())</font>

You should put in the character of the wingdings that you want.
This way, only part of the text can be wingdings.
Wingdings 2

断舍离 2024-10-07 06:27:35

最后我得到了解决方案
这是下载项目并运行它的链接。

http://uploading.com/files/2mmf34m8/Nestle%2BNew.rar/

我已经开发了类,然后使用列表来设置布尔变量真/假。另一方面,我在 rdlc 报告中使用图像控件来设置图像。

您只需设置图像文件夹中已有的图像路径即可。

干杯。

Finally I got solution
here is the link download the project and run it.

http://uploading.com/files/2mmf34m8/Nestle%2BNew.rar/

i have developed class and then used list to set bool variable true/false. while on other hand i used image control in rdlc report To set image.

You just need to set image path which are already in image folder.

Cheers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文