Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: suppress section when subreport no data Post Reply Post New Topic
Author Message
ru_ny
Newbie
Newbie


Joined: 03 Nov 2008
Location: Thailand
Online Status: Offline
Posts: 5
Quote ru_ny Replybullet Topic: suppress section when subreport no data
    Posted: 03 Nov 2008 at 4:49am

My report have many section and many subreport.

1 section / 1 subreport
 
I would like to suppress section when subreport not return data so
 
I don't want to space
 
How can I do?
 
Thank you...
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 03 Nov 2008 at 7:05am
Hi
 
Did you try Suppress Blank Section,Also you can suppress subreport when it is blank.
 
 
So right click subreport ,then format Subreport check the box which says
Suppress Blank Subreport
 
Then right click the section in which the subreport is placed, the select section expert in that check Suppress Blank Section
 
Cheers
Rahul
IP IP Logged
ru_ny
Newbie
Newbie


Joined: 03 Nov 2008
Location: Thailand
Online Status: Offline
Posts: 5
Quote ru_ny Replybullet Posted: 04 Nov 2008 at 3:30am
Thank you for your suggestion.
 
But I use crystal report 8.5  I don't  find
 
"
So right click subreport ,then format Subreport check the box which says
Suppress Blank Subreport "
 
How can I do next?
 
Thank you....
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 04 Nov 2008 at 4:12am

Hi

What did you not find
 
When you right click subreport the format subreport the in format editor Subreport Tab Option you will find
 
check the box which says "Suppress Blank Subreport "
 
Cheers
Rahul
IP IP Logged
ru_ny
Newbie
Newbie


Joined: 03 Nov 2008
Location: Thailand
Online Status: Offline
Posts: 5
Quote ru_ny Replybullet Posted: 04 Nov 2008 at 7:41pm

 Thank you again...

My crystal report 8.5  don't have  "format editor Subreport Tab Option"

It have common tab / border tab / subreport tab / font tab.

How can I do next?
 
Thank you....

 

 

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 05 Nov 2008 at 12:33am
Hi,
 
GO TO SUBREPORT TAB DO YOU SEE OPTION THERE WHICH SAYS
 
 
SUPPRESS BLANK SECTION
 
CHEERS
RAHUL
IP IP Logged
ru_ny
Newbie
Newbie


Joined: 03 Nov 2008
Location: Thailand
Online Status: Offline
Posts: 5
Quote ru_ny Replybullet Posted: 05 Nov 2008 at 6:35pm
This version doesn't have
 
SUPPRESS BLANK SECTION  in Subreport  Tab
 
CryCryCry
 
 
Do you have any way to solve this?
 
Thank you....
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Nov 2008 at 2:39am
can you mail me your report
 
 
also the version of Crystal Report you using....
 
Cheers
Rahul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Nov 2008 at 2:52am
Hi here is the solution by Seagate
 
Symptom

In Crystal Reports (CR) 8.5 and earlier, how do you suppress a section in the main report that contains a blank subreport?

For example:

A subreport is placed in the group header of the main report.

If the subreport does not return data, the group header still contains a blank space the size of the subreport.


Resolution

To suppress a section in the main report that contains a blank subreport, the following procedures must be completed.

====================

NOTE:

" These instructions apply to Crystal Reports 6, 7, 8 and 8.5.

" New to Crystal Reports 9 is the 'Suppress Blank Subreport' check box. For more information on how to suppress blank subreports in CR 9, refer to our knowledge base article c2011893.

====================

· creating a duplicate subreport

· placement of a duplicate subreport

· creating a formula to test if the subreport is blank

· conditionally suppressing a section that contains original subreport

· minimizing a duplicate subreport and resizing the section

Crystal Reports 7, 8 and 8.5

------------------------------

To suppress a section that contains a blank subreport in CR 7, 8 and 8.5, complete the following:

Creating a Duplicate Subreport

------------------------------

You must create another subreport based on the original subreport. To create a duplicate subreport, complete the following steps:

1. From the main report in CR, right-click the subreport.

2. From the fly-out menu, select 'Save Subreport As'.

3. Provide a name for the duplicate subreport and click 'Save'.

Placement of a Duplicate Subreport

----------------------------------

Place the duplicate subreport into the section above the original subreport. For example, if the original subreport is contained in the group header of the main report, create another group header and place the duplicate subreport into it.

To insert a section into the report, complete the following steps:

1. In design mode, right-click the left gray margin where the subreport is located.

For example:

If the subreport is located in the group header, right-click the left gray margin at the group header level.

2. From the fly-out menu, select 'Insert Section Below'. You notice another section is inserted into the report labeled 'b'.

For example, by inserting another group header you notice that there is group header a and group header b.

3. Select the original subreport, drag and drop it into the second section.

4. Insert the duplicate subreport by selecting 'Subreport', from the 'Insert' menu.

5. Select 'Choose a report', from the 'Insert Subreport' dialog box.

6. Browse to find the duplicate subreport.

7. Select the report and click 'Open'.

8. Click 'OK'. The duplicate subreport will be attached to the cursor.

9. Insert the subreport in the new section (such as group header b from step 2).

10. In the main report, on the 'Edit' menu click 'Subreport Links'. The top drop-down box will contain both the original and duplicate subreports. Compare these two subreports and enure that the fields in the 'Filed(s) to link to' box are the same. Also, check that the parameter in the bottom-left drop-down box and the field in the bottom-right drop-down box are the same.

Creating A Formula To Test If The Subreport Is Blank

----------------------------------------------------

In the duplicate subreport, you must create a formula to test whether the contents of the subreport are blank. The results of this formula are going to be stored as a shared variable and shared with the main report.

To create this formula, complete the following steps:

1. Right-click on the duplicate subreport and from the fly-out menu, select 'Edit Subreport'.

2. From the 'Insert' menu, select ' select 'Field Object'. This launches the 'Field Explorer'.

3. Select 'Formula Fields' and select the 'New' icon.

4. Type a name into the 'Formula Name' box and click 'OK'. For example, CheckForNull. This launches the formula editor.

5. Create a formula similar to the following:

// @CheckForNull

Whileprintingrecords;

Shared BooleanVar Suppress;

If IsNull(Count({Table.field})) or Count(Table.field) = 0 then Suppress:= TRUE

Else Suppress:= FALSE

6. Place @CheckForNull in the Report Header of the duplicate subreport.

Conditionally Suppressing a Section Containing Original Subreport

-----------------------------------------------------------------

To conditionally suppress the section that contains the original subreport, complete the following steps:

1. From the 'Format' menu, select 'Section'. This launches the 'Section Expert'.

2. From the 'Section Expert' dialog box, select the section that contains the original subreport.

3. Click the 'X+2' button beside the 'Suppress (No drill down) check box. Ensure the checkbox is clear.

4. In the 'Format Formula Editor', create a formula similar to the following:

// The section will be suppressed if

// variable Suppress is True

Whileprintingrecords;

Shared BooleanVar Suppress = True

Now when you preview the report, you notice that the sections that contain a blank subreport are suppressed. However, the section that contains the duplicate subreport is visible on the main report. In order to suppress the section still visible you must minimize and resize the section.

Minimizing the Duplicate Subreport & Resizing the Section

---------------------------------------------------------

To minimizing the duplicate subreport on the main report and resize the section, complete the following steps:

1. From the main report, right-click the duplicate subreport.

2. From the fly-out menu, select 'Edit subreport'.

3. Suppress all of the sections in the duplicate report.

4. Select the main report.

5. Right-click the duplicate subreport, and from the fly-out menu, select 'Format Subreport'.

6. From the 'Format Editor', select the 'Border' tab.

7. From 'Line style', select 'None' for Left, Right, Top, Bottom.

8. Select the main report.

9. Resize the section that contains the duplicate subreport to be as small as possible.

Crystal Reports 6

-----------------

Before you begin this process, you will need to download uflstore.zip from our website at:

http://support.businessobjects.com/search

The reason you need to obtain this file is because shared variables were introduced in Crystal Reports 7. In order to suppress a section that contains a blank subreport in Crystal Reports 6, you will need to use the store and fetch function.

To suppress a section that contains a blank subreport in Crystal Reports 6, complete the following:

Creating a Duplicate Subreport

------------------------------

You must create another subreport based on the original subreport. To create a duplicate subreport, complete the following steps:

1. From the main report in CR, right-click the subreport.

2. From the fly-out menu, select 'Save Subreport As'.

3. Provide a name for the duplicate subreport and click 'Save'.

Placement of a Duplicate Subreport

----------------------------------

Place the duplicate subreport into the section above the original subreport. For example, if the original subreport is contained in the group header the main report, create another group header and place the duplicate subreport into it.

To insert a section into the report, complete the following steps:

1. In design mode, right-click the left gray margin where the subreport is located.

For example:

If the subreport is located in the group header, right-click the left gray margin at the group header level.

2. From the fly-out menu, select 'Insert Section Below'. You notice another section is inserted into the report labeled 'b'.

For example, by inserting another group header you notice that there is group header a and group header b.

3. Select the original subreport, drag and drop it into the second section.

4. Insert the duplicate subreport by selecting 'Subreport', from the 'Insert' menu.

5. Select 'Choose a report', from the 'Insert Subreport' dialog box.

6. Browse to find the duplicate subreport.

7. Select the report and click 'Open'.

8. Click 'OK'. The duplicate subreport will be attached to the cursor.

9. Insert the subreport in the new section (such as group header b from step 2).

10. In the main report, on the 'Edit' menu click 'Subreport Links'. The top drop-down box will contain both the original and duplicate subreports. Compare these two subreports and enure that the fields in the 'Filed(s) to link to' box are the same. Also, check that the parameter in the bottom-left drop-down box and the field in the bottom-right drop-down box are the same.

Creating a Formula to Test if the Subreport is Blank

----------------------------------------------------

In the duplicate subreport, you must create a formula to test whether the contents of the subreport are blank. The results of this formula are going to be stored as a shared variable and shared with the main report.

To create this formula, complete the following steps:

1. Right-click on the duplicate subreport and from the fly-out menu, select 'Edit Subreport'.

2. From the 'Insert' menu, select ' select 'Field Object'. This launches the 'Field Explorer'.

3. Select 'Formula Fields' and select the 'New' icon.

4. Type a name into the 'Formula Name' box and click 'OK'. For example, CheckForNull. This launches the formula editor.

5. Create a formula similar to the following:

// @CheckForNull

Whileprintingrecords;

If IsNull(Count(Table.field)) or Count(Table.field) = 0 then

StoreBooleanVar ("Suppress", True)

else StoreBooleanVar("Suppress", False)

6. Place @CheckForNull in the Report Header of the duplicate subreport.

Conditionally Suppressing a Section Containing Original Subreport

-----------------------------------------------------------------

To conditionally suppress the section that contains the original subreport, complete the following steps:

1. From the 'Format' menu, select 'Section'. This launches the 'Section Expert'.

2. From the 'Section Expert' dialog box, select the section that contains the original subreport.

3. Click the 'X+2' button beside the 'Suppress (No drill down) check box. Ensure the checkbox is clear.

4. In the 'Format Formula Editor', create a formula similar to the following:

// Conditional suppression on section containing original subreport

Whileprintingrecords;

FetchBooleanVar("Suppress") = True

Now when you preview the report, you notice that the sections that contain a blank subreport are suppressed. However, the section that contains the duplicate subreport is visible on the main report. In order to suppress the section still visible you must minimize and resize the section.

Minimizing the Duplicate Subreport & Resizing the Section

---------------------------------------------------------

To minimizing the duplicate subreport on the main report and resize the section, complete the following steps:

1. From the main report, right-click the duplicate subreport.

2. From the fly-out menu, select 'Edit subreport'.

3. Suppress all of the sections in the duplicate report.

4. Select the main report.

5. Right-click the duplicate subreport, and from the fly-out menu, select 'Format Subreport'.

6. From the 'Format Editor', select the 'Border' tab.

7. From 'Line style', select 'None' for Left, Right, Top, Bottom.

8. Select the main report.

9. Resize the section that contains the duplicate.

==========================

TIP:

To distinguish between the section containing the duplicate subreport and the section containing the original subreport, you can format one of the sections with a different background color.

To format a section with a background color, follow these steps:

1. Right click the section to select it and from the fly out menu select 'Format Section'.

2. In the 'Section Expert' select the section containing the duplicate subreport from the 'Sections' dialog box.

3. Click the 'Color' tab and select the 'Background Color' check box.

4. Select the desired color from the list.

==========================


Keywords

SUPPRESS BLANK SUBREPORT SUBREPORTS CONCEAL NULL FORMAT FAKE MOCK DUMMY C2000055 Seagate Crystal Reports Seagate Info Blank Subreports Conditional Suppression , c2005853

IP IP Logged
ru_ny
Newbie
Newbie


Joined: 03 Nov 2008
Location: Thailand
Online Status: Offline
Posts: 5
Quote ru_ny Replybullet Posted: 09 Nov 2008 at 10:21pm
Thank you very much .... rahulwalawalkar

I will try solve this problem by your suggestion ...



IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.