21

I am trying to create some reports, and I want to show the headers in each page of the reports. I create a table and the uppermost row becomes my header, but it is only shown for the first page of the report.

The only thing that can be seen in each page are page headers and page footers, but these parts do not allow a table inside them. All I can use for my work on a page header is a textbox.

I tried to write my headers into some texboxes and put them side by side, but then the report data drifts from the headers' bounds.

How do I fix this problem?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Bastardo
  • 4,144
  • 9
  • 41
  • 60

6 Answers6

38

In your .rdlc report there is small down arrow at the bottom right corner with red box, you need to click on “Advanced Mode”. enter image description here

By clicking, your row and column groups will expand with new fields named “Static” as shown below: enter image description here

Now, click “Static” in Row Groups list, and check the properties on the right side: Set “RepeatOnNewPage” to “True” and “KeepWithGroup” to “After” as shown below: enter image description here

Now, repeat above procedure for all “Static” rows in Row Groups list, except the “Static” rows present under the different group (encircled with black color in following figure), do same for the Details group (encircled with red color): enter image description here

This enables you to view Header Row on each page of .rdlc report.

yeasir007
  • 2,110
  • 2
  • 28
  • 43
29

image

In Row Groups below the main page of the report, there is a line "Static" writing on it. It is a tablix member and to repeat the headers use below attributes

RepeatOnNewPage = True and KeepWithGroup = After

Bastardo
  • 4,144
  • 9
  • 41
  • 60
  • Ah thank you. I was struggling with this myself now. Never noticed the advanced tab. Thanks a million! – DeVil Aug 17 '11 at 09:12
4

When you select table header row and see its properties it has property called RepeatOnNewPage set it to true and table header will repeat on every new row.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
IordanTanev
  • 6,130
  • 5
  • 40
  • 49
  • thank you but this property does not seem to appear on Tablix Properties. – Bastardo Mar 29 '11 at 07:55
  • @EmreVeriyaz it is not a property of the Tablix first you must select the table header row by clicking its header row and then you will see this property in the property grid – IordanTanev Mar 29 '11 at 08:32
  • i understand Iordan i did open the property grid but there is nı RepetOnNewPage property in there there is only RepeatWith property mentioning about Repeat, i answered my question, solved the problem, thank you for your help. – Bastardo Mar 29 '11 at 08:36
  • @Bastardo did you find any soloution to the problem? i have the same problem – stian64 Jun 02 '17 at 13:14
  • @stian64 i answered my own question back then which solved my problem https://stackoverflow.com/a/5469839/647884 – Bastardo Jun 03 '17 at 14:31
2

This post gives a brief explanation on how to repeat header rows on each page in Reportviewer: http://blog.teamgrowth.net/index.php/net/how-to-repeat-header-rows-on-each-page-in-reportviewer-rdlc

Hope it will help!!

Cheers!! :)

Melissa D
  • 31
  • 1
1

I am creating a dynamic table - report. I can not group the rows. When I export the XML file to PDF, I'm writing

//......
string deviceInfo =
" <OutputFormat>PDF</OutputFormat>" +
" <PageWidth>11in</PageWidth>" +
" <PageHeight>8.5.0in</PageHeight>" +
" <MarginTop>0.05in</MarginTop>" +
" <MarginLeft>0.05in</MarginLeft>" +
" <MarginRight>0.05in</MarginRight>" +
" <MarginBottom>0.05in</MarginBottom>" +

" <KeepWithGroup>After</KeepWithGroup>" +
" <RepeatOnNewPage>true</RepeatOnNewPage>" + 
" <FixedData>true</FixedData>"+
" <RepeatHeaderOnNewPage>true</RepeatHeaderOnNewPage>" +
"</DeviceInfo>"; 
try
{
byte[] bytes = reportViewer1.LocalReport.Render(
"PDF", deviceInfo, out mimeType, out encoding, out filenameExtension,   //horizontal page
out streamids, out warnings);
using (FileStream fs = new FileStream(filename, FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
fs.Close();
}
 return filename;
}
//....

, but the title can only see on a 1 page. What should I write in order to see the header on each page?

Irena
  • 111
  • 4
  • I can not help that except suggesting you to ask it as a question to the site Irena. – Bastardo Jun 04 '12 at 06:56
  • Thanks,Robolover. I have already asked your question here on the site, but I have not received a response – Irena Jun 04 '12 at 08:37
  • ok then I'll start a bounty for it.Can you somehow update your question everyday if you do not get a response, please? – Bastardo Jun 04 '12 at 08:49
  • I'm still waiting for an answer ... Here is my question – Irena Jun 05 '12 at 04:19
  • http://stackoverflow.com/questions/10869315/how-to-show-a-title-on-each-page-of-the-report-dynamically-created-reportviewer – Irena Jun 05 '12 at 04:20
  • I've started the bounty Irena, try editing your question so you can draw more attention to it. Good luck. – Bastardo Jun 06 '12 at 07:31
1

follwing solution work for me..when you have just single group data in your rdlc file.for multiple group data on file it wont

To repeat columns with row headers in a row group area

1.In Design view, right-click the corner handle for a selected tablix data region, and then click Tablix Properties.

2.On the General tab, under Row Headers, select Repeat header rows on each page.

3.Click OK.

firefly
  • 419
  • 1
  • 8
  • 18