Endless pages, when setting the height of the footer and header manually
Hello,
I hope the title desribes the issue more or less precise.
It's about the following:
the user can design "main reports" (with / for the data of an invoice, offer
etc.) and he can design PageStyle-reports (with the layout for the main
reports).
While designing the layouts, he can determine the height of the footer band
and the height of the header band, which shall be reserved for the
PagyStyle-report, once "merged" with the main report. Also he can determine,
on which pages of the main report the PageStyle-report shall be visible.
So I'm using the OnStartPage event to check that setting and if the layout
shall be visible on the current page, I'm setting main reports's footer
height and header height accordingly to the settings made in the
PageStyle-report. So it can be, that pages do variantly have either their
original heights for those bands or the heights reserved in the
PageStyle-report.
This seems to work in general, but I'm having some issues anyway.
1. An offer with several positions (detail band content) is showed using one
of the main reports. No PageStyle used yet. The report has 7 pages and I can
navigate to all of them. Page 2 is really the last one and the navigation
next-buttons are inactive, once on the last page.
2. I'm adding a PageStyle report to the main report and during this process
the PageStyle is being set to visible := true for all pages (current
setting).
3. The reserved height fot the header is 60mm and the one for the footer is
50mm, so in the OnStartPage event I'm setting the header height and footer
height of the main report accordingly to these settings.
4. Problem: despite the fact, that each page has less available room for the
content, the pagecount remains at 7. While navigating through these 7 pages
I noticed, that
4.1. positions 2 and 3 are gone
4.2. page 7 is the last one according to the viewer, but shows the content
of 2-3 pages before the end
4.3. the navigation buttons for the pages are still active (despite being at
the page 7 already) and when I try to navigate to the next page (8) or the
latest one, the viewer becomes very busy (25% CPU usage) and is seemingly
trying to display /determine / generate more pages. The OnStartPage even is
being fired all the time during the process, so I guess there is something
wrong with the page count and the viewer doesn't know what to show.
4.4. PageCount is definitely wrong, since I'm not seeing all my position and
the content of the summary on the apparently last page (7) and am allowed to
navigate to the further pages
4.5. Missing positions are surely not correct too.
Now I don't know what is going wrong. Is the way I'm doing it correct? Do I
have to call anything to recalculate the pagecount or so? Different order of
the steps?
First I thought, that the reason could be the height of the summary band,
which is being set dynamicaly. It has the option "keep together" activated.
So I thought, that if it's height is bigger than the available place on the
page, the problem could occur, but that's is not the reason, it seems, since
removing of the content of the summary band or changing of the option didn't
change anything.
I hope you know what I mean and can help me. It looks pretty strange to me
this time.
Thanks,
Mark
I hope the title desribes the issue more or less precise.
It's about the following:
the user can design "main reports" (with / for the data of an invoice, offer
etc.) and he can design PageStyle-reports (with the layout for the main
reports).
While designing the layouts, he can determine the height of the footer band
and the height of the header band, which shall be reserved for the
PagyStyle-report, once "merged" with the main report. Also he can determine,
on which pages of the main report the PageStyle-report shall be visible.
So I'm using the OnStartPage event to check that setting and if the layout
shall be visible on the current page, I'm setting main reports's footer
height and header height accordingly to the settings made in the
PageStyle-report. So it can be, that pages do variantly have either their
original heights for those bands or the heights reserved in the
PageStyle-report.
This seems to work in general, but I'm having some issues anyway.
1. An offer with several positions (detail band content) is showed using one
of the main reports. No PageStyle used yet. The report has 7 pages and I can
navigate to all of them. Page 2 is really the last one and the navigation
next-buttons are inactive, once on the last page.
2. I'm adding a PageStyle report to the main report and during this process
the PageStyle is being set to visible := true for all pages (current
setting).
3. The reserved height fot the header is 60mm and the one for the footer is
50mm, so in the OnStartPage event I'm setting the header height and footer
height of the main report accordingly to these settings.
4. Problem: despite the fact, that each page has less available room for the
content, the pagecount remains at 7. While navigating through these 7 pages
I noticed, that
4.1. positions 2 and 3 are gone
4.2. page 7 is the last one according to the viewer, but shows the content
of 2-3 pages before the end
4.3. the navigation buttons for the pages are still active (despite being at
the page 7 already) and when I try to navigate to the next page (8) or the
latest one, the viewer becomes very busy (25% CPU usage) and is seemingly
trying to display /determine / generate more pages. The OnStartPage even is
being fired all the time during the process, so I guess there is something
wrong with the page count and the viewer doesn't know what to show.
4.4. PageCount is definitely wrong, since I'm not seeing all my position and
the content of the summary on the apparently last page (7) and am allowed to
navigate to the further pages
4.5. Missing positions are surely not correct too.
Now I don't know what is going wrong. Is the way I'm doing it correct? Do I
have to call anything to recalculate the pagecount or so? Different order of
the steps?
First I thought, that the reason could be the height of the summary band,
which is being set dynamicaly. It has the option "keep together" activated.
So I thought, that if it's height is bigger than the available place on the
page, the problem could occur, but that's is not the reason, it seems, since
removing of the content of the summary band or changing of the option didn't
change anything.
I hope you know what I mean and can help me. It looks pretty strange to me
this time.
Thanks,
Mark
This discussion has been closed.
Comments
Are you assigning the height of the header and footer bands inside the
OnStartPage as well? From your description below, it sounds like either the
timing at which you are changing the height of a band or the actual values
you are giving them is confusing the engine and producing an incorrect
output. If you would like, you can send a simple example demonstrating this
behavior to support@digital-metaphors.com that I can run on my machine and I
can take a look at it for you.
It seems like all the issues related to your application stem from trying to
edit a loaded report from within the existing main report while it is
running. This (as you know) can be a timing nightmare.
You might reconsider your approach to this feature. It is still a good idea
to use the pagestyle band to load a pre-canned template into a subreport,
however it may be necessary to alter the template being loaded to match the
specifications of the main report before you make the call to Report.Print.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
yes, I'm assigning the height of the header and footer bands inside the
OnStartPage as well.
I can imagine, that OnStartPage is not the best place to do it, but that was
my first thought and I didn't figure out another way to achieve it so far.
Maybe you have a better idea.
I've send a sample project to support@digital-metaphors.com where you can
reproduce it.
Regards,
Mark
I received your email and will be in contact with you soon.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com