Search code examples
visual-studio-2010rdlcrdl

How to center the report title in RDLC file


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

Solution

  • 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.