cancel
Showing results for 
Search instead for 
Did you mean: 

How to Programmatically suppress Groups in SAP Crystal Report

Former Member
0 Kudos

I am using SAP Crystal Report 2011 version 14.0.3.613 RTM.

I have a report with multiple groups along with the column header and detail.

I would like to use 1 report to have 3 versions of the report where each version of the report has 1 or more groups suppressed and the other groups are not suppressed.

This report is being viewed in an ASP.Net page with VB.net as the code-behind.

Is there a way to tell the report from the code-behind what groups to suppress and what groups not to suppress?

Sincerely,

Keith Jackson

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Yes and no.  What you would need to do is create a parameter that will indicate which groups to suppress or show.  You'll also set the group values based on the parameter so that if the group is being suppressed it will evaluate to some constant value or if it's being shown it will use whatever field or formula you need to group on.  You would then set the parameter in the code-behind in order to display the report.

-Dell

Former Member
0 Kudos

Hi Dell,

    I figured it would involve setting a parameter and I am familiar with setting a parameter from the code-behind.

    Can you give me more details on how to set things up in the report?

Sincerely,

Keith Jackson

DellSC
Active Contributor
0 Kudos

If you can give me a few more details about how you want to suppress things, I can tailor my response to your situation.

-Dell

Former Member
0 Kudos

Hi Dell,

    There is a radio button on the ASP.Net page for the user to select which version of the report.

    Here are some examples of the 3 different versions of the report:

Version 1 - Only show Part break group.  Suppress Overall Group summary.

Workcenter     Shift      Part No.          Lapse Time          Uptime

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

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

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

                                                          110                       175               <--- Part Break Summary

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

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

                                                          65                        215               <--- Part Break Summary


Version 2 - Show Part break group and show Overall Group summary. No groups suppressed.

Workcenter     Shift      Part No.          Lapse Time          Uptime

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

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

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

                                                          110                       175               <--- Part Break Summary

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

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

                                                          65                        215               <--- Part Break Summary

                         Blanking 1 - Shift 1                                                     <--- Overall summary

                                             Total Lapse Time          Total Uptime

                         B777666          110                              175

                         B445544          65                                215

                     

Version 3 - Suppress Part break group.  Only Show Overall Group summary.

Workcenter     Shift      Part No.          Lapse Time          Uptime

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

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B777666          22                         35

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

Blanking 1          1        B445544          13                         43

                         Blanking 1 - Shift 1                                                     <--- Overall summary

                                             Total Lapse Time          Total Uptime

                         B777666          110                              175

                         B445544          65                                215

Sincerely,

Keith Jackson

DellSC
Active Contributor
0 Kudos

So, if I understand correctly, you will be suppressing specific sections of the report, not changing the groups around.  Is that correct?

If you set up a parameter (I'll call it {?ShowSections}) that will take the values 1, 2, and 3, here's what you'll do in the report:

NOTE:  You'll be working in the suppression formulas.  DO NOT check the "Suppress" check box for any of these sections.

- Go to the Section Expert.

- For the Part group footer, use this formula:  {?ShowSections} = 3

- For the section where the overall summary is located, use this formula:  {?ShowSections} = 1

This should get you what you're looking for.

-Dell

Former Member
0 Kudos

Hi Dell,

    Yes, you are correct.  I would just be suppressing specific sections.

    I will try what you stated.  I may have questions since it is still kind of vague.

    I will let you know.

Sincerely,

Keith Jackson

Former Member
0 Kudos

Hi Dell,

    Where to put these formulas?

    How will the report know to suppress the specific sections?

Sincerely,

Keith Jackson

DellSC
Active Contributor
0 Kudos

In the Section Expert, for the specific sections, click on the formula button to the right of the Suppress checkbox.  To get to the Section Expert, right-click in the area to the left of the report design.

-Dell

Former Member
0 Kudos

Hi Dell,

    That amazingly works.

    Can you explain how does it know to suppress a section when a suppress formula is put in without putting a check-mark next to Suppress in the Section Expert?

Sincerely,

Keith Jackson

DellSC
Active Contributor
0 Kudos

It suppresses when the formula evaluates to true.

-Dell

Former Member
0 Kudos

That makes sense.

Thanks for your help Dell!

Sincerely,

Keith Jackson

Answers (0)