Page Breake problem.
I have a Report with this structure
Report---|
|--PBSection-|--PbChild
|---PBChild
|--PBChild
If I DONT set The Titleband.NewPage to true on the last child my report
just stand and take all CPU (not complete the printing)
when I do a Report.LastPage;
Someone have an idea what can be the problem?
(it seems like it got stuck in one of the pipelines on the previous
page)
BR
Magnus.
Report---|
|--PBSection-|--PbChild
|---PBChild
|--PBChild
If I DONT set The Titleband.NewPage to true on the last child my report
just stand and take all CPU (not complete the printing)
when I do a Report.LastPage;
Someone have an idea what can be the problem?
(it seems like it got stuck in one of the pipelines on the previous
page)
BR
Magnus.
This discussion has been closed.
Comments
The structure seems to have been a bit fucked up by my client:
It should look like:
Report
|
PBSection
|
---------------------------------------
| | | |
PbChild1 PBChild2 PBChild3 PBChild4
|
PBChild5
PBChild3 and PBChild5 have a master/slave relation.
If I set the PBChild4's titleband to NewPage:=False My report hangs in
the MasterPipeline for PBChild3 when I do a ppViewer1.LastPage. IF
NewPage is set to tru it print's just fine.
The rows before it passes just fine:
ppViewer1.Reset;
ppViewer1.Report.PrintToDevices;
ppViewer1.LastPage;
ppViewer1.FirstPage;
I never had this problem With RB 5.0 (And almost the same code except
that I had to change the master/slave thing when I can't connect a
pipeline to a detailband anymore)
Isn't it strange that It pass the PrintToDevices fine and got stuck in
the ppViewer1.LastPage ?
/M
ppViewer1.LastPage;
ppViewer1.FirstPage;
What if you set Report.PassSetting to psTwoPass, because you won't have to
call these two methods on the viewer to set the report to go to the last
page then to the first page. The call to PrintToDevices will cause all of
the pages to be generated in the first pass and the viewer will be on the
first page for the start of the second pass.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Ok. Jim!
But I have made a own preview with buttons. If I like to go to the last page
(with the last page button I do a ppViewer1.LastPage and then it tries to go to
page (8) of (7)!!!! if I have the NewPage set To false on the last subreport's
titleband. And the report got stuck in in my master/slave report (it looks
like).
If I have NewPage set to true it works fine. I think it's strange that it works
to do the PrintToDevices and itt looks just fine and everything get's fucked up
when I try to go to last page. (the same problem accour if I start a ppDesigner
and take preview and try to go to the last page. It works fine in the designer
too if the new page is set to true.
Ok. Jim!
But I have made a own preview with buttons. If I like to go to the last page
(with the last page button I do a ppViewer1.LastPage and then it tries to go to
page (8) of (7)!!!! if I have the NewPage set To false on the last subreport's
titleband. And the report got stuck in in my master/slave report (it looks
like).
If I have NewPage set to true it works fine. I think it's strange that it works
to do the PrintToDevices and itt looks just fine and everything get's fucked up
when I try to go to last page. (the same problem accour if I start a ppDesigner
and take preview and try to go to the last page. It works fine in the designer
too if the new page is set to true.
StatusBar.Panels[0].Text:=
IntToStr(TppReport(ppViewer1.Report).AbsolutePage)+'('+IntToStr(TppReport(ppViewer1.Report).AbsolutePageCount)+')';
And it prints Page 1(7) for the frist page. if I use ppViewer1.NextPage to step
I can step to the last page and it says Page 7(7)
But if I use ppViewer1.LastPage it tries to step to page 8(7)
I have it set to psTwoPass
/Magnus
the problem.
Instead of using the NewPage property of the titleband, try setting the
PrintBehavior property of the subreport to Section. Section style
subreports always start on a new page and you can omit using the
Titleband.Newpage property, if that is causing the problem.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
chose if I want a new page or not. (if I force a new page it works).
Anyhow If I use:
ppViewer1.GotoPage(TppReport(ppViewer1.Report).AbsolutePageCount);
instead of
ppViewer.LastPage
it works fine.
Shouldn't this be the same? Looks like a bug to me....
Another strange thing I have seen on some of my old Reports (not all) made in D5
and RB5 is that when I open them in RB6 (don't know if it is the same in RB6.02)
And have The TitleBand.NewPage set to tru it generates a Empty Page (not only a
NewPage)
If I have the New Page set to false it still give me a NewPage (using pbChild
subreports). I don't have this problem with New Reports (at lease not yet)
though.
/M
shown in your diagram, where the titleband new page property was set, and I
didn't get the behavior you are describing in my viewer project. Can you
create a demo and send it to support@digital-metaphors.com
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
now)
It seeams like you missunderstand me... The problem only accour when I don't
have the new page set. (if I have it set it works just fine)
But anyway, I will send you a demo when I get some spare time.
BR
Magnus