Solved

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

Posted on 2009-03-30
20
4,042 Views
Last Modified: 2012-05-06
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
Comment
Question by:LucyRRD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
  • 4
20 Comments
 
LVL 35

Expert Comment

by:James0628
ID: 24025060
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
 

Author Comment

by:LucyRRD
ID: 24025232
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 24025607
Make sure the subreport and any fields in the group footer aren't too wide for the main report.

mlmcc
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 35

Expert Comment

by:James0628
ID: 24035154
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
 

Author Comment

by:LucyRRD
ID: 24039235
Yes, James.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24040964
Sounds like there is a field behind the subreport that is too wide

mlmcc
0
 

Author Comment

by:LucyRRD
ID: 24041160
I've checked there is no extra field behind the subreport.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24041469
Is this happening on the development machine?

mlmcc
0
 

Author Comment

by:LucyRRD
ID: 24042291
Yes, it is on the development machine.
0
 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 24045534
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
 

Author Comment

by:LucyRRD
ID: 24050470
James,

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

Regards,
Lucy


0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24053172
Can you upload the report?

Make a copy and change the extension to TXT

mlmcc
0
 

Author Comment

by:LucyRRD
ID: 24054446
Sorry, I can not upload the file due to the company policy. Thanks for your help!


0
 
LVL 35

Expert Comment

by:James0628
ID: 24055844
You accepted my post as the solution.  Did the PageNumber <> TotalPageCount thing work for you after all?

 James
0
 

Author Comment

by:LucyRRD
ID: 24059931
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
 
LVL 35

Expert Comment

by:James0628
ID: 24065578
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
 

Author Comment

by:LucyRRD
ID: 24077179
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
 
LVL 35

Expert Comment

by:James0628
ID: 24083092
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
 

Author Comment

by:LucyRRD
ID: 24102009
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
 
LVL 35

Expert Comment

by:James0628
ID: 24103630
> 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

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question