在 rdlc 文件中隐藏文本框时保留空白 [英] Preserve white space when hiding textbox in rdlc file

查看:45
本文介绍了在 rdlc 文件中隐藏文本框时保留空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个报告,该报告的左侧有一个图像,该图像根据传入报告的参数有条件地可见.页面右侧还有另一个文本框.

I've created a report that has an image on the left that is conditionally visible based on a parameter that's passed in to the report. There is another textbox on the right side of the page.

我观察到当图像的 Hidden 属性设置为True"时,右侧的文本框会保持在正确的位置.当图片的 Hidden 属性设置为 =IFF(1 = 1, true, true) 时,那么右边的文本框就会向左移动,报表看起来很难看.

I'm observing that when the image's Hidden property is set to "True" then the textbox on the right side stays in the right place. When the image's Hidden property is set to =IFF(1 = 1, true, true), then the textbox on the right is being shifted to the left, and the report looks ugly.

如何让隐藏的对象仍然占据所有必要的空间,并使用表达式将其设置为隐藏?

How can I have the hidden object still take up all the necessary space, and set it as hidden with an expression?

推荐答案

为了防止出现您所看到的行为,您可以将一些其他对象(如矩形或一条线)放置在您的设计器上与您的图像相同的位置,并且让它占据与左侧图像相同的水平空间.

To prevent the behaviour that you are seeing, you can place some other object (like rectangle or a line) onto your designer in the same location as your image and have it take up the same horizontal space as the image on the left.

当图片被隐藏时,该对象将保留在那里并阻止右侧文本框移动.

When the image is hidden, this object will remain there and prevent the right side textbox from moving.

我会让这个对象在设计器中可见,并在运行时设置它的颜色以匹配您的背景颜色(例如,白色),这样您就看不到它了.

I would keep this object visible in the designer and set its colour to match your background colour (e.g., White) during runtime so that you don't see it.

我还会给它一些描述性的名称,例如 LineWhichPreventsTextBoxFromMovingWhenImageIsHidden,以便报告的某些未来维护者不会无意中将其删除,从而导致重大更改.

I would also give it some descriptive name like LineWhichPreventsTextBoxFromMovingWhenImageIsHidden so that some future maintainer of the report does not inadvertently remove it and thus cause a breaking change.

这篇关于在 rdlc 文件中隐藏文本框时保留空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆