• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4444
  • Last Modified:

How to suppress the last blank page within the Crystal report in VB.NET?

The VB.NET crystal report does not have the option of "Suppress Print if no records", while the regular crystal report 9.0 has this option.
I placed a subreport in a group footer section, the report is grouped by date and I set the new page after the date changes. The last blank page always prints out after the subreport dispays. Ive also tried using the null counter to suppress the subreport and the group footer section, but it still does not work. Please help!
0
LucyRRD
Asked:
LucyRRD
  • 9
  • 7
  • 4
1 Solution
 
James0628Commented:
I'm not entirely sure what you're trying to do, because you talk about a new page after the subreport and trying to suppress the last blank page and trying to suppress the subreport.

 If you're trying to keep CR from doing the "new page after" at the very end of the report, try going to that section, unchecking the "new page after" option, clicking on the formula (X+2) button beside "new page after" and putting in

not OnLastRecord

 That should tell CR to not do the "new page after" when it is on the last record (ie. at the very end).

 James
0
 
LucyRRDAuthor Commented:
James,

I've tried using 'not OnLastRecord' as you suggested. It still does not work.
What I'm trying to do is to suppress the blank last page. I have a main report and a subreport at the group footer section.

 If I totally suppress the group footer section that contains the subreport (for testing purposes), I won't get any blank report. If I just suppress the subreport itself (for testing purposes) without suppressing the group footer, I still get the blank page. It seems the "Suppress blank section" within the group footer section does not work.

Regards,
Lucy
0
 
mlmccCommented:
Make sure the subreport and any fields in the group footer aren't too wide for the main report.

mlmcc
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
James0628Commented:
So, if you suppress the subreport (as you said, for testing purposes) and use "suppress blank section" on the group footer, you still get the extra page?

 James
0
 
LucyRRDAuthor Commented:
Yes, James.
0
 
mlmccCommented:
Sounds like there is a field behind the subreport that is too wide

mlmcc
0
 
LucyRRDAuthor Commented:
I've checked there is no extra field behind the subreport.
0
 
mlmccCommented:
Is this happening on the development machine?

mlmcc
0
 
LucyRRDAuthor Commented:
Yes, it is on the development machine.
0
 
James0628Commented:
FWIW, "not OnLastRecord" (without the quotes, of course) can work for this kind of thing, but it depends on your data and the structure of your report.

 Another thing you could try would be unchecking "new page after" and entering a formula like:

PageNumber <> TotalPageCount - 1

 You may need to change the right side (eg. leave off the "- 1" or use "- 2").  To be honest, I think that that's kind of a longshot, but it's easy enough to try.

 Otherwise, it might help if we could see the report.  You could attach it to a post here.  Just change the extension to one of the types that EE accepts, like TXT.

 James
0
 
LucyRRDAuthor Commented:
James,

I've tried the formula: PageNumber <> TotalPageCount - 1, it adds more blank pages to the report.

Regards,
Lucy


0
 
mlmccCommented:
Can you upload the report?

Make a copy and change the extension to TXT

mlmcc
0
 
LucyRRDAuthor Commented:
Sorry, I can not upload the file due to the company policy. Thanks for your help!


0
 
James0628Commented:
You accepted my post as the solution.  Did the PageNumber <> TotalPageCount thing work for you after all?

 James
0
 
LucyRRDAuthor Commented:
James,

Thanks for your help. Neither "not OnLastRecord", nor PageNumber <> TotalPageCount work. I think you are right, it's the data issue. The report prints a blank sheet only when the last day of the report date range does not have any data. Do you have any other suggestions to get rid of the last blank page?

Regards,
Lucy
0
 
James0628Commented:
Well, first of all, if my suggestions didn't help, you certainly don't need to accept that post as the solution.  And once you accept a solution, you're not likely to get any more suggestions (although I've been known to do that :-).  If we ultimately find no solution, you can ask to have your points refunded.

 > The report prints a blank sheet only when the last day
 > of the report date range does not have any data.

 You said that you're grouping by date.  Is that for each day?  If a day actually does not have any records, I wouldn't expect it to show up at all on the report, much less give you a group footer that adds an unwanted blank page.  IOW, I'm not sure I'm following you there.  Is the report using the date range in the record selection (which would completely eliminate any records outside that range from the report), or is it using suppression?

 James
0
 
LucyRRDAuthor Commented:
James,

My main report left-out-joins a Calendar file and is grouped by the date from the Calendar file. The report then calls the subreport at the group footer section and passes the date parameter to the subreport to get data from a different file.

The reason I'm doing this is that certain days only load the data from the subreport, while the main report is blank. I'm using the suppression of the blank subreport.

Note: The main report is very complicated and contains another subreport.

Regards,
Lucy

0
 
James0628Commented:
It seems like the basic problem is that when you use "suppress blank section", when the section is blank and gets suppressed, you still get the "new page after".

 Earlier you seemed to be saying that you only get the extra blank page when the subreport for the last day on the report is blank.  Is that correct?  If the subreport for the last day is not blank, you also get a new page after that.  Why is that not an "extra" blank page?  Just trying to understand the report better.

 James
0
 
LucyRRDAuthor Commented:
James,

I only get the extra blank page when both of the main report and the subreport for the last day on the report is blank.  If the subreport for the last day is not blank, I do not get a new page after that.

Thanks,
Lucy
0
 
James0628Commented:
> If the subreport for the last day is not blank, I do not get a new page after that.

 But if the section that the subreport is in is set to "new page after", you should get a new page after that section whether the subreport is blank or not.    That's not what's happening?

 Hmm.  Or is it that in one case the report goes to a new page, and then there is some more data on the main report, so it's not just a blank page, but in the other case when it goes to the new page, there is nothing more on the main report, so you're left with a blank page?

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 9
  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now