Pergunta

I'm modifying an ActiveReports (for .NET v.2 SP3 Build 4.3.0.1261) report, which is bound to a list of objects. The detail section is set up with two page breaks, so that there are (up to) 3 pages produced for each object.

I say 'up to' because pages 2 & 3 are not relevant to every object, so some objects will generate only one page. I am achieving this from the Detail_Format event by disabling the pagebreaks and reducing the Detail height when only the first page is relevant.

My issue is that I am trying to show the page footer only on the first page for each object, i.e. hide it for pages 2 and 3, but I cannot find a way to do this. I can't just track the page count because the number of pages per object is variable.

Any thoughts on how I can achieve this, even if it means a different approach to playing with the detail layout?

Foi útil?

Solução

After shotgunning a lot of the eventhandlers, I managed to figure it out.

Put PageFooter.Visible = True in the Detail.Format eventhandler, and put PageFooter.Visible = False in the Report.PageStart eventhandler.

In case anyone is interested, my earlier problems were caused by trying to set a counter to zero in the Detail.Format eventhandler and increment it the Report.PageStart eventhandler and then make the footer not visible when the counter was greater than zero. But due to the timing of the events this meant that

  • page 1 had a footer
  • page 2 had a footer
  • page 3 did not have a footer
  • page 1 of the next object did not have a footer
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top