Subreport, best practice

Posted by: pete-newman on 4 August 2017, 2:35 pm EST

  • Posted 4 August 2017, 2:35 pm EST

    i have a main report that lists banking files, with a group footer that calculates the number of files / transaction and different payment rtype. On my page footer i have the normal page x of xx

    I need to add a subreport that may or may not be displayed dependant on the main report.  That part is easy enough. what i need to know is

    1. where should i put my subreport as it is NOT to be included in any of the main reports grouping counts
    2. ensure that the page numbering stays in sequence

    i.e  if only only the main report is printed the  the page footer states page 1 of 1, but if one page of the report is printed and 2 pages of subreports then the main reoprt shows page 1 of 3 and the sub report carrues the sequence through with page 2 of 3 etc
  • Replied 4 August 2017, 2:35 pm EST

    I would put your subreport in a section that will only be repeated once. This normally means the subreport control is in a GroupHeader or GroupFooter with nothing else in it and the GroupHeader's DataField property is blank or set to a value that repeats only once per needed subreport instance. The main report will still continue with its page sections and page numbering normally.
  • Replied 4 August 2017, 2:35 pm EST

    thank you for that, i now however have a second problem in the fact that the page headers on my main form are being put on my subreport. The page header on the subreport needs to be different   On my main repoty i have the field titles set in the page header to ensure that they are repeated on each page if the main report is more than one page long. I may be doing this all wrong so welcome any suggestions
  • Replied 4 August 2017, 2:35 pm EST

    Subreports do not render their page headers, you'll need to change the PageHeader in it's Format event if you need the information changed.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels