Page Numbering SubReports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

If anyone could help it would be great,

My report is setup like this:

subrpt1
subrpt2
subrpt3
subrpt4

All the subreports are their own report, the main report combines them all
to make a report package.

What I have been trying to figure out is how to keep the original page
numbers of the subreports. but the page number just appears as 0's once the
reports are viewed from the main report. I have tried making my own page
counter which works and increments properly when the subreport is viewed by
itseld, however it does not increment properly when the subreport is
displayed from the main report. Is there a way to do this or am I trying to
do something that is impossible?

Thanks,
 
Tamiyra said:
My report is setup like this:

subrpt1
subrpt2
subrpt3
subrpt4

All the subreports are their own report, the main report combines them all
to make a report package.

What I have been trying to figure out is how to keep the original page
numbers of the subreports. but the page number just appears as 0's once the
reports are viewed from the main report. I have tried making my own page
counter which works and increments properly when the subreport is viewed by
itseld, however it does not increment properly when the subreport is
displayed from the main report. Is there a way to do this or am I trying to
do something that is impossible?


I've been thinking about this all weekend and I believe it's
possible to get that effect. You can not display the page
header/footer sections in a subreport, so we'll have to get
tricky with the main report page numbers. Since you didn't
explain much about how the subreports are arranged in the
main report, I can't be specific.

Here's some thoughts on this subject. Place an invisible
text box named txtStartPage on the main report, probably in
the report header section.

Add some code to somewhere(?) (could some main report
section's Format event, or in the subreport's Open event or
in the subreport header's Format event). In the main
report, the code would be:
Me.txtStartPage = Me.Page
or in the subreport:
Parent.txtStartPage = Parent.Page

Now, the main report's footer section can display the
subreport's page number in a text box using the expression:
=Page - txtStartPage + 1

I do hope you've done something to get each subreport to
start on a new page.
 
Yes I have each report starting on a new page, it was only difficult for the
first report because it is a variable length.
This is the code I used for that in case it can help others... searching the
forum

If Me.rptIncomeSummary.Report.HasData Then
If Me.rpt1099Broker.Report.HasData Or Me.rpt1099Div.Report.HasData Or
Me.rpt1099Int.Report.HasData Then
Me.pgbrkA.Visible = True
basPageCount.resetpgnumber
Else
Me.pgbrkA.Visible = False
End If
Else
Me.pgbrkA.Visible = False
End If


In regards to how my report is set up all the reports are linked based on a
client account number and they are all in the details sections of the main
report.
I may have to switch this around to try what you are saying, but will post
if I am successful in the attempt or not.
 
Ok I will try to be more specific in describing my problem here, cause i
attempted to code what you suggested but became totally lost..

My main report consists of a detail section only. In that detail section
there are 4 subreports and that is it.(other than a page break after the
first subreport)

Subreport1
subreport2
subreport3
subreport4

Subreport 3 and 4 are both one page long always and do no require th page
numbers to be on them.

Subreports 1 and 4 are basically set up the same, a header for the account
number then a details sections that lists all the detail lines. The page
numbers must be displayed in the subreport headers along with the other
information that is there.

And the page numbers must number the pages in these subreports starting at
one for the first page that is in each report. The way I have it now, both
reports show the numbers correctly when ran alone, but when called from the
main report, the [page] variable doesn't pass correctly and is displayed as
0's on all pages in all reports. I want to keep the page number the same on
these reports as it was when I ran the reports by themselves. So that it
resets the page number at the beginning of a new report. I have tried using
variable and such, which I can get working when running the subreports by
themselves, but as soon as they are ran from the main report, all hell breaks
loose and it calls the onformat command a crazy amount of times which then
disrupts the counters that I have in place.
 
Back
Top