cancel
Showing results for 
Search instead for 
Did you mean: 

Suppress group header when subreport is also suppressed

Uli_Stoeckl
Participant
0 Kudos
666

Hi,

    

I hope anyone could help me to solve my problem with a report. This report has a main report and a sub report.

 

The main report has a group header for every single project (Detail selection and group footer are suppressed permanently). Within this GH I have placed one sub report.

The sub report shows master data which only exist for character in the sub report.

Further it is suppressed dynamically if one date character > prompt date. This works fine.

                                                                                                                                                                                                                                                            

My problem is now having empty group header. My purpose was to suppress the GH as well when belonging sub report is suppressed.

V.v. if the condition date character > prompt date is false both GH and sub report are shown.

Thanks

Uli

View Entire Topic
Former Member
0 Kudos

May be,a group selection formula written in Reports > Selection Formula > Group would work.

Not sure how the exact condition will look like, but following would be the condition based on your statement "date character > prompt date is false":

date character < prompt date

The condition mentioned above will obviously need to be substituted with the actual database field and the prompt date parameter

-Prathamesh

Uli_Stoeckl
Participant
0 Kudos

Hi Prathamesh,

Hi Abhilash,

the group selection formula regrettably doesn´t work. The reason is:

  • the value for 'prompt date' is transfered from main report to sub report. All needed data for 'date character' does only exist in the data source for the sub report.

Do I need a shared variable if I would use the value of 'date character' as a group selection formula on main report? How should a proper shared variable look like?

Thanks

-Uli

abhilash_kumar
Active Contributor
0 Kudos

You can't use a shared variable in the Group Selection Formula.

How do you Suppress the Subreport?

You should be able to use the same formula to suppress the Group Header 2 as well.

-Abhilash

Uli_Stoeckl
Participant
0 Kudos

Hi Abhilash,

as default it doesn´t work with the same formular to suppress GH2. In the sub report this formular works well, because all value are available.

For the main report (it has another query as a datasoure) the required character does not exist. Therefore this formular (from the sub report) could not retrieve the right values, only '#' is displayed.

Would a shared variable an idea to transfer the formular-value from the sub report to depending project in GH2/main report?

Thanks

Uli

abhilash_kumar
Active Contributor
0 Kudos

You can use a shared variable, however it needs the Subreport to execute first.

So, if you place the Subreport in the Group Header 2, you can only access the value of the shared variable in a section below Group Header 2. It will even work in Group Header 2b.

So you can suppress any section below Group Header 2 using the shared variable but Group Header 2.

Well, if the Subreport is blank for a particular Group and the option 'Suppress Blank Subreport' is checked, then the option 'Suppress Blank Section' for the Group Header 2 should suppress the whole section in my opinion (as long as Group Header 2 has nothing other than the Subreport of course).

Try this:

1) Create a Group Header 2b section

2) Move all fields in Group Header 2a to 2b except the Subreport

3) Set the option 'Underlay following sections' for the Group Header 2a

4) Check the option 'Suppress Blank Section' for the Group Header 2a

5) For Group Header 2b, create a conditional suprpession formula (in the Hide option) with the code below:

shared stringvar variable_name;

variable_name = "";

6) In the Subreport, you would need a shared variable with this code:

shared syringvar variable_name;

variable_name := {string_field};

Let me know how this goes.

-Abhilash

Uli_Stoeckl
Participant
0 Kudos

Hi Abhilash

thanks a lot. This solves my problem. I just had to delete the term

variable_name = ""; within the main report.

Now it works as intended.

Thanks,

Uli