We help IT Professionals succeed at work.

problems with forcenewpage in quickrep i get blanks pages

croudo
croudo asked
on
1,318 Views
Last Modified: 2010-04-04
in quick report i have rbPageHeader, Group band with has child = true, rbDetail band and Group footer.
in the group band i set the forcenewpage to true
and when i have group that cach more the one page i get on page blank and one page full (pages number 2,4,6,8 is blank)
please help me
croudo assaf.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
of course if there are more that one grouped records for that group, then it forces new pages itself on end page, so forcing new page prints a blank (empty) one....

Author

Commented:
so what i need to do????
i didnt understand your answer.
croudo assaf.
CERTIFIED EXPERT

Commented:
ok...sorry maybe i must explain it better....

First of all: why did you set forcenewpage to true? What do you need? A quickreport prints automatically new pages on end page if there're still records to be printed...
for example...
if you have 20 records for every group quickrep prints about 15 records for page so every group need 2 pages...in this case: page 1 and page 2 for a half, then forcenewpage prints the nex group on 3rd page...
But if the group ends exactly at the end of the page, then the next group starts at the top of the new page, but with force new page it will jump a page....

So if you really need to force a new page set the property in Groupfooter instead of Group Header....

Author

Commented:
if i will set the footer with forcenewpage it will do the work but....in every new page i will get the total of the prior group in the top of the page and right after it the next goup.
i have client that have many departments with about 500 lines each department and he what to start in new page every departmet.
thanksssss croudo assaf
CERTIFIED EXPERT

Commented:
OK....
I'm doing a test with forcenewpage in GroupHeader (not in FooterBand) and it works fine...
You have a rbPageHeader too...There's ForceNewPage True there too?

Author

Commented:
i think the problem is:
the group supposed to be at every new page by natural.
the forcenewpage event work right before the band printed, so before the band r going to be printed on new page the forcenewpage pass the group to the next page and left the current page blank NO??
how i supposed to do it?????????????
CERTIFIED EXPERT

Commented:
Found it! it's because Group Header Has child...you have to set it to false and it'll work....

Author

Commented:
if u r doing test then use all the bands that i used(please)
and make sure that the goup have more then one page DT.
thankss man. :)
CERTIFIED EXPERT

Commented:
yes...i'm doing a test with a pageheader, groupband, detailband, and footerband as your and a database with about 50 records for group...
when i use haschild in groupheader it prints blank pages (2, 4, 6 and so on...)
but if haschild is false all is ok

Author

Commented:
i did set the hasChild of the group to false and its didnt work
4 me :(.
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
i just send thankss man :)

Author

Commented:
i just Increased to 250 pppppppplease :(
CERTIFIED EXPERT

Commented:
so croudo...was the sent suggestion good? I wanna know it 'cause i want to post here the solution as this thread now is PAQ...

Ah....why a B?
Top Expert 2004

Commented:
of course i like to see the solution also

Author

Commented:
hi i solve the problem like this(i replayed it to your mail Ferruccio68)

procedure TfRPT01.QRGroup2BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
{qrGroup2.Expression='DPTNM'}  
  if pParam<>dtTempSql.FieldByName('DPTNM').AsString    then qrGroup2.ForceNewPage:=True
      else qrGroup2.ForceNewPage:=False;
{in the entry and after group print i set pParam=dtTempSql.FieldByName('DPTNM').AsString}
end;

{thankss any way croudo assaf (croudoman)}
CERTIFIED EXPERT

Commented:
well...better then...
Thanks for the points and no other to say for the grading: it's right so :))
CERTIFIED EXPERT

Commented:
just an addition to future readers:
i've suggested this....
[...]
Then i saw that you change the group header height depending on the Check...
 
This things may create a Report Height oversizes...
 
BTW i'd try this way...
 
Don't set the forcenewpage anyway and add this :
procedure TfRPT01.QRBand4AfterPrint(Sender: TQRCustomBand;
  BandPrinted: Boolean);
begin
  {you must only chek if you are in the last page...maybe with the recordcount of the dataset...
   if not last record then}
  QuickRep1.NewPage;
end;
[...]

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.