How to center the report title in RDLC file

淺唱寂寞╮ 提交于 2019-12-12 10:06:51

问题


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

回答1:


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:

This will be printed on two pages and on each one the title will be centered.


回答2:


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.



来源:https://stackoverflow.com/questions/9127866/how-to-center-the-report-title-in-rdlc-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!