How to stretch a data band to fill available space on the page

Hello everyone!

I am having some issues trying to get a data band to stretch to take up the available space on a form. I have several different sections of my report:

Page Header

Data Band 1

Data Band 2 Header

Data Band 2

Data Band 2 Footer

Data Band 3

Page Footer

I would like to have Data Band 3 grow to fill the remaining space on the form, but I can't seem to get this to work consistently. Either it sizes itself very small (and doesn't take up the available space) or it breaks the page and grows onto the next page (which I don't want to happen).

I did try to size the band with the following code, but it doesn't seem to accomplish what I want. Is there a better way of doing this? It seems like there probably is... I also feel like the float heights reported by report sections doesn't report correctly?

  private void PageHeader1_AfterPrint(object sender, EventArgs e)

  {

   a += PageHeader1.Height;

  }


  private void Data1_AfterPrint(object sender, EventArgs e)

  {

   a += Data1.Height;

  }


  private void Data2Header_BeforePrint(object sender, EventArgs e)

  {

   a += Data2Header.Height;

  }

   

  private void Data2_AfterPrint(object sender, EventArgs e)

  {

   a += Data2.Height;

  }


  private void Data3_BeforePrint(object sender, EventArgs e)

  {

   Data3.Height = 960.12F - a - 32.13F;

  }


What am I missing? I appreciate any help anyone can provide. Thank you!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.