0

I want to develop a report where the report header section values change on different pages and the report body should bind according to the header values. And the header section should display in each page of the report even though there is a subreport page breaks happens.

Now I am passing 2 data set from C# code. One is for report header and one is for report body. For report body I am using a subreport and binding the subreport from C# code according to the key field on the report header dataset.

I have created some hidden textbox and first binding those textboxes from the report header dataset. Then by using the expression "=ReportItems!txtbx_bdy.Values" for the header section textboxes I am binding the report header section.

Now the problem is when the sub-report in the body section has more number of records it breaks to next page, and the header textboxes are displaying blank from the second page onwards.

Please help me out if anybody already fixed this type of issue. I need to fix this issue as soon as possible.

Thanks,

2 Answers2

1

The simplest solution is to create report without report header and place whole thing into table in report body. You can repeat table headers on each page if you have unchangeable part of the header. Then you can group your data and use group header(s) as your report headers as well. You can set them to repeat on each page.

InitK
  • 1,261
  • 13
  • 21
  • Here the problem is I have some fields in header section which may change from page to page and my report body should bind accordingly. If I will use table header then on each page I will get the same value(initial value) for those fields while my report body may bind correctly for different values from header as I am binding the body using subreport from the code. I mean first I am getting the distinct header key values and binding the subreport by passing those key value. Please suggest what shall I do in this scenario?? – Aurobinda Dash Sep 18 '14 at 15:21
  • You don't have to use only table header. You can use group header rows (and you can add as many as you wish) - these rows will be "aware" of new values. – InitK Sep 18 '14 at 15:32
  • Can you please send me one good example what you are talking about. I will be very thankful to you if it works.You can post here or can send an email on aurobindo.mca@gmail.com – Aurobinda Dash Sep 18 '14 at 16:38
  • In continuation of the above message I just want to add that I am using client rdlc report using VS 2008/2005 not VS 2010/2012. – Aurobinda Dash Sep 18 '14 at 16:49
  • Any help shall I expect from you please sir – Aurobinda Dash Sep 19 '14 at 13:26
  • What exactly would you want me to try in the rdlc xml file?? – Aurobinda Dash Sep 19 '14 at 15:22
  • The above thing i tried. I drag a table in the report body and in the table detail row I put my subreport and in that row I created a group and in that group header row I drag the rectangle which contains the header fields. But I have not mentioned any thing in the table header row. It also did not give me appropriate result. Any suggestion on this??? – Aurobinda Dash Sep 19 '14 at 15:31
  • Please share the xml(rdlc) file. I will have a look on that and try to implement my thing. Could you please share ur email Id please? – Aurobinda Dash Sep 19 '14 at 15:44
  • You just need to "play" with it. Maybe do away without subreport. I cannot tell you what exactly you need to do because I don't know business logic of the report you are working on and I don't have time to get too deep into it. The idea is that you can use report header for some "static" values and to display values of textboxes within report body including within your table cells. – InitK Sep 19 '14 at 16:48
  • But, you can remove table header all together and use table header for static values (like logo etc.) and group header for those fields that need to be different on each page (given that you are starting new page on each new value of your grouping criteria. This is something you need to experiment with it, how exactly you use it depends on the business logic. Good luck. – InitK Sep 19 '14 at 16:49
0

The easiest fix that I can think of, but I'm not familiar with rdlc is this:

Create a hidden page header for your subreport.

Add your hidden textbox for your subreport into the page header for your subreport, so that textbox is located on every page of your subreport.

Chuck Buford
  • 321
  • 1
  • 9