SSRS:报告标签位置动态

发布于 2024-08-31 03:26:20 字数 214 浏览 5 评论 0原文

我有一份在多个标签中显示客户地址的报告。

我的客户使用开窗信封来邮寄。我需要地址标签位置可配置。

比如,我将有一个数据库表,用于存储每个客户每个标签的顶部/左侧位置。根据此表,我需要在报告上放置地址标签。

我认为,这可以通过表达式实现,但是 Location 属性不提供设置表达式并使标签的顶部和左侧动态的功能。

有人对如何实现这一目标有任何想法吗?

I have a report which displays customer address in multiple labels.

My customers use windowed envelopes for mailing. I need the address labels position to be configurable.

Something like, I'll have a database table which stores the Top/Left position of each label per customer. Based on this table, I need to position the address labels on my report.

I thought, it is doable by expressions, but Location property doesn't provides ability to set an expression and make the label's top and left dynamic.

Anybody, any ideas, on how to achieve this?

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

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

发布评论

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

评论(4

人生百味 2024-09-07 03:26:20

正如您所提到的,您无法为位置属性设置表达式。我以前想做这个,但似乎这项工作没有解决方案。

As you mentioned, you cannot set an expression for location property. I want to do this before but it seems that there is no solution for this work.

千里故人稀 2024-09-07 03:26:20

抱歉,重复的帖子

我遇到了和你一样的问题。我通过使用旧的 HTML 技巧解决了这个问题。它涉及在图像中使用透明.gif。您放置图像(链接到 gif),然后将标签放在上面。使用参数,您可以通过在两个控件的隐藏属性中设置表达式来切换要显示的项目。

Sorry for the duplicate post

I had the same problem as you did. I got around the problem by using an old HTML trick. It involves using a transparent.gif in an image. You put your image (linked to the gif), then put your label on top. Using a parameter, you can toggle which item to appear by setting an expression in the hidden property for both controls.

開玄 2024-09-07 03:26:20

正如其他人所说,它不受支持。然而,对于基本报告来说,有两种可能的丑陋解决方法。

解决填充问题。
您无法在标签的位置设置公式,但可以使用填充选项。

  1. 因此,您可以将标签设置为与报表一样宽,与区域一样高。
  2. 另外,将标签的水平对齐方式设置为“左”,垂直对齐方式设置为“上”。
  3. 然后,在左侧和顶部填充中添加公式以偏移文本。

输入图片此处的描述

您还可以通过将水平对齐设置为“右”并使用右侧填充而不是左侧填充来从右侧偏移字段来实现右对齐偏移标签。使用相同的方法,您可以使用“底部”垂直对齐和底部填充从底部偏移。

丑陋的一面:
此方法将在报表设计器中造成混乱,因为所有动态标签将相互重叠并占据静态标签上的所有空间。另外,请注意,使用此方法,您将无法执行一些奇特的操作,例如在文本和超链接周围添加边框。

解决子报告问题。
如果标签的不同位置的数量非常少。您可以为每种可能性创建一个子报告,并使用公式来显示正确案例的正确子报告。遗憾的是,这不适用于标头中的标签,因为那里不允许使用子报表。

As stated by others, it isn't supported. However, here are two ugly work around possible for basic reporting.

Work around with padding.
You can't set formula on the label's location, but you can use padding option instead.

  1. So you can set the label as wide as the report and as tall as the region.
  2. Also, set the label's horizontal alignment to "Left" and Vertical alignment to "Top".
  3. Then, add a formula in left and top paddings to offset the text.

enter image description here

You can also achieve a right aligned offsetted label by setting the Horizontal alignment to "right" and using right padding instead of the left one to offset the field from the right. With the same recipe, you can offset from the bottom by using "bottom" vertical alignment and bottom padding.

The ugly side:
This method will create a mess in the report designer as all dynamic label will overlap each other and take all the space over static label. Also, please note that with this method, you won't be able to do fancy stuff like adding borders around the text and hyperlinks.

Work around with sub report.
If the number of different positions for the label(s) are really low. You can create a subreport for each possibility and use a formula to display the right subreport for the right case. Sadly, this doesn't work for labels in the header as subreport aren't allowed there.

手心的海 2024-09-07 03:26:20

没有解决办法,因为不支持!

来自MS在线社区支持...

“据我所知,报告中文本框的位置是静态的而不是动态的,因此它不会向左移动。”

参考:http://forums.asp.net/t/1433297.aspx

No solution, as it is not supported!!!

From MS online community support...

"As far as I know, the position of the textbox in the report is static not dynamic, so it will not shift to left."

Reference: http://forums.asp.net/t/1433297.aspx

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