Print Page | Close Window

Subreport empty, but showing with a border, on rpt

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1253
Printed Date: 15 May 2024 at 1:58am


Topic: Subreport empty, but showing with a border, on rpt
Posted By: N11689
Subject: Subreport empty, but showing with a border, on rpt
Date Posted: 30 Aug 2007 at 7:44am
I have subreports linked to the main report.  Sometimes they return data, sometimes they do not.  If they do not return data, I am suppressing the sections within the subreport as well as checking the Suppress Blank Section for each subreport section.  On the main report, I have the subreport set to Suppress Blank Subreport.
 
This subreport resides in a section with other data that will always print.
What is happening, which never did with our VB6 app, is that the report is putting a fine border around the entire subreport even though the subreport is blank and is defined with all Borders set to None.  It's as though it is showing the space where a subreport would print data.
 
I need to have the subreport suppressed totally, without any borders.  Why is it showing?
 
I have even tried moving the subreport to the section above where it noramally prints and suppressing it there..same results. 
 
We are using VB.NET 2005 and Crystal XI Release 2 (w/Service Pack 2).
We are using Crystal Reports for .NET's object models.
 
We develop our reports and CRXIR2, but use our vb.net program to run the report.
 
Any help will be appreciated.  Thank you.



Replies:
Posted By: N11689
Date Posted: 30 Aug 2007 at 11:03am
After doing a little more research, it is not the actual subreport that has the 'border' around it, it is the data in the subreport.
 
We have one field in the report.  It is a 'picture' type field.  It displays an image if the image exists in the database, otherwise blank. 
 
So, Crystal is displaying a blank image with a border around it.  How do I prevent this from displaying at all?  The field itself has all the border line styles set to None the Border color is set to black, but no borders should be printing at all, so the border color should not apply.
 
I don't understand why this is happening.


Posted By: N11689
Date Posted: 30 Aug 2007 at 11:19am
One more thing...
 
I just tried putting a white border around the image (with all the border lines styles still set to None) and a thin black border prints around the blank image.


Posted By: N11689
Date Posted: 30 Aug 2007 at 12:50pm
RESOLVED!  Sorry, after even more research discovered the following:
 
The subreport runs an SQL stored procedure.  We insert the results into a temp table.  One of the columns in the table is a bit field that will tell us whether or not rows were returned.
 
Well, rows were always getting returned even if the picture/blob/image field was blank.  Why?  The image is defined as a nullable image in the database, so it was always returning something because of the null value in the image.  So the rows returned was always true.  I needed to add an image is not null statement to the where clause in the stored procedure (or modify each subreport and add IsNull(image) to each image's suppress condition).  It was easier to modify one sql stored procedure.
 
Problem solved.  Although we never had this problem with our VB6 application...just with the .NET applications.


Posted By: BrianBischof
Date Posted: 30 Aug 2007 at 2:18pm
Wow. I had no idea how to comment on the original question b/c I had not seen this behavior before. Glad you got it resolved.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window