如何将 RDLC 文件中的报告标题居中

发布于 2025-01-02 08:11:47 字数 386 浏览 3 评论 0原文

我试图将位于 RDLC 矩阵报告的报告标题中的报告标题居中 - 这应该非常简单,但我正在努力实现它。

我正在使用 VS 2010 (SP1) 报表设计器来编辑 RDLC。该报告非常简单 - 它包含带有两个文本框的报告标题和包含矩阵(交叉表)报告的正文。在两个报告标题文本框中,一个用于显示静态报告标题,另一个用于显示单个报告参数。

报告内容如我所愿,只是我无法将报告标题居中。标题在文本框宽度内居中,但我找不到一种方法来说明文本框应该生成整个页面宽度。我无法将文本框宽度设置为页面宽度,因为

  • 如果文本框宽度设置为比矩阵宽度多 x 英寸,则在呈现报告时,内容宽度会从呈现的矩阵放大 x 英寸,从而导致页面宽度重叠。
  • 如果边距或页面大小发生更改,则需要重新设置文本框宽度

I am trying to center the report title placed within report header on RDLC matrix report - this should have been quite straight-forward but I am struggling to achieve it.

I am using VS 2010 (SP1) report designer to edit the RDLC. The report is quite simple - it contains report header with two text-boxes and body containing matrix (cross-tab) report. Out of two Report Header text-boxes, one is used for display static report title while other is used to display the single report parameter.

The report content is as I want except I am unable to center the report title. The title get centered within the text-box width but I could not find a way to say that text-box should spawn entire page width. I cannot set text-box width to the page width because

  • if text-box width is set more than matrix width by say x inches then when report is rendered, content width gets enlarged by x inches from a rendered matrix resulting in page-width overlap.
  • it will need re-setting the text-box width if margins or page-size is changed

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

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

发布评论

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

评论(2

沙沙粒小 2025-01-09 08:11:47

一年半后......我使用了你的解决方案,但后来发现了另一个:
单击报告的空白区域,会出现一个名为 ConsumeContainerWhitespace 的属性。它指示是否应保留矩阵右侧和下方的空白(或任何可以调整大小的内容)。但可能还有其他副作用。
当报表变得比页面宽时,它在查看器中看起来像这样:
矩阵大于页面宽度
这将打印在两页上,并且每一页上的标题都将居中。

And a year and a half later... I used your solution but then found another one:
Clicking on the empty area of the report there is a property called ConsumeContainerWhitespace. It indicates wether white space to the right and below a matrix (or any content that can be resized) should be preserved. Might have other side effects though.
When the report gets wider than the page it looks like this in the viewer:
Matrix larger than page width
This will be printed on two pages and on each one the title will be centered.

小兔几 2025-01-09 08:11:47

唉!有时间玩一下 RDLC - 这是解决方法。虽然,这并不完全是我想要的(居中的报告标题),但它已经足够接近了!

这里的基本思想是矩阵(交叉表)报告会增加其宽度,因此您需要将报告标题与矩阵相关联。因此,请删除报表标题或页标题,并在矩阵中的行组上方添加一个或多个静态行。将这些行用于报告图块和报告参数。通过将报告标题文本框居中,您可以获得居中的报告标题。

Alas! got some time to play with RDLC - here's the work-around. Although, its not exactly what I want (a centered report title), its close enough!

Basic idea here is that matrix (cross-tab) report grows its width so you need to associate the report title with the matrix. So remove report header or page header and instead add one or more static row above the row-group in the matrix. Use these rows for Report tile and report parameters. By centering the report title text-box, you get some-what centered report title.

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