Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent print blank first page? 2

Status
Not open for further replies.

alexbelovtt

Programmer
Nov 15, 2005
51
US
I'm using Crystal Reports 11, and I have a report with subreports in it.
One of subbreports (in ) has groups in it.
That subbreport has requirement to print each group on to the new page. I have done that by checking New page before option on group header (Thanks Ido!)
In certain situation all previous subreports must be suppressed and that report must be printed on first page.
My problem is that at the first of the report, I get an extra blank page if all previous subbreports are suppressed.
I tested:
(Not OnfirstRecord)
not (pagenumber=1) and their combination, but whatever I try first page printed blank (with header and footer)
If any of previous section is not suppressed everything works fine.
Thank you
Alex
 
if the standard methods don't work, try something cruder. Like a running-total count of records, suppressing when it is zero or 1.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you, Williams.
I do not want suppress first page, because special header, instead I do want first record appears on first page
Alex
 
go to 'format subreport' by right clicking on the subreport and select 'Subreport' tab among the four tabs you have. In this you'd see a box (which you should check in) for 'Suppress blank report'.

Then on the main report, where ever you have your subreports , go to tje section expert and check in 'Supress blank section' and it should work.
 
Thank you.
I try all that settings.
It’s doesn’t help, because subreport has two group and first grout has NewPagBefore checked.
If I uncheck NewPagBefore reports printed from first page, but all groups print on first page as well. I do need begin each group form new page.
If additionally if I check NewPagBefore for subreports group and add formula:
not (pagenumber=1)
report printed from 1 page, but again all groups printed in same page even if page more than 1.
 
Why can't you use 'Newpageafter' in your group footer's section expert? I feel that it would help!
 
Thank you.
Good suggestion, but does not help
I change settings for subreports.
That is good test, because now I know that is not subreports problem, because it still print blank fist page. And sure blank last page.
But last blank page easy removed by formula:
not onlastrecord
or:
onlastrecord and
pagenumber = totalpagecount

Something is wrong with settings for main reports sections.
Each section has own subreports, but not one of them has NewPageAfter or keepTogether checked….

 
Try this one:

Please go to each of your subreports and go to all the sections' expert (which are not supressed by you) check in the box besides 'Suppress blank section' option.

But this shoud be done for all the subreports including report footers.
 
You also might try selecting the subreport and going to format->subreport->common and unchecking "Keep object together".

-LB
 
Thank you LBass and chinjk for the quick reply!
In additional to your suggestions I add formula:
‘if pagenumber=1 then true
Else
False’
for NewPageAfter in footer of not suppressed subreport.
Now I’m trying to describe those settings for myself :)
Thanks again for very valuable help.
Everything is working perfect.
Alex
 
Sorry, to borrow you again, but I just accomplish all test cases and find out one more issue.
If subreport that have groups, appears last in main report (12 sections are suppressed after that subreport) than I have blank last page. I have formula in group footer for NewPageAfter in subreport :
‘if pagenumber=1 then true
Else
False’
But it’s doesn’t help.
Also I apply all your suggestions:
'Suppress blank section' for each of my subreports, including report footers and
Format->subreport->common and unchecking "Keep object together" by selecting each subreport for suppressed subreports.
Did I miss anything?
Thank you.
 
Replace with the following code where you have this code
//‘if pagenumber=1 then true
Else
False’
//


if pagenumber=1 then true
Else
if pagenumber=totalpagecount then true
else False

I'm hoping that this is waht your report needs. If not , then I didn't understand your problem properly so please explain it once again.

 
Thank chinjk,
I check all settings and use your formula, but that does not help.
Then I change formula to be (please, correct me if I’m wrong):

if pagenumber=1 then true
Else
if pagenumber=totalpagecount then false
Else
False
Same result – last page is blank. Only header and footer is printing.
 
if pagenumber=1 then TRUE
Else
if pagenumber=totalpagecount then TRUE
else False


Please copy the above and paste in it wherever you were typing in the code for suppressing the last blank page.
 
Same result – last page is blank. Only header and footer are printing on last page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top