如何在 RDLC 文件中居中报告标题 [英] How to center the report title in RDLC file

查看:45
本文介绍了如何在 RDLC 文件中居中报告标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将放置在 RDLC 矩阵报告的报告标题中的报告标题居中 - 这应该非常简单,但我正在努力实现它.

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.

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

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

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

推荐答案

唉!有时间玩 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.

这篇关于如何在 RDLC 文件中居中报告标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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