Skip to Content
avatar image
Former Member

Conditional Display Of group Sections In Crystal Reports 2011

Hi Every one good evening,please guide me how to achieve this requirement.

In My report i have 2 Sections.In one section we have a group based on category filed(coming from store template table)

In one section we have a group based on Brand filed(coming from store template table)

1.Category

2.Brand

All 2 sections have some fields(fields are same for all groups).

I need to display a specific section based on some value(Prop value) selected in database.

Prop value is a column from Cust_conv_properties table.

If in database they gave Prop value=Category then i have to show Category group section data

If in database they gave Prop value=Brand then i have to show Brand group section data.

How can i achieve this.Please guide me.

Please find the attachments.

Addtional to this

I want to try like this, for category field i will take one report and i will apply group on category, for brand field i will take another report and i will apply group on brand then,I will merge this in to one report.

So now how to show/hide these reports based on prop value selected in data base table.(how to link)

Suggest me.

Database table.gif (208.0 kB)
ReportDesign.gif (123.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 09, 2013 at 04:43 PM

    A little confusing . . .

    Is [BRAND] a sub-grouping of [CATEGORY]?

    Or do you have only one group?

    It sounds like you have one group and, based on [PROP_VALUE], the group name is either [BRAND] or [CATEGORY].

    Try creating a formula named GROUP1_Name.

    If [PROP_VALUE]=”Brand” then [BRAND] else [CATEGORY]

    Add the formula to the detail section.

    Then use the formula as the Group_by field.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      OK . . . it sounds like . . . .

      1.  You a have a main report using Cust_conv_properties table as your data source. 

      2.  There are two sub-reports in your main report.  The sub-reports are sr_BRAND and sr_CATEGORY.

      3.  For each record in the main report you want to display one sub-report. 

           if [Cust_conv_properties.prop_value] = “category” then display sr_CATEGORY.

           if [Cust_conv_properties.prop_value] = “brand” then display sr_BRAND.

      My solution would be

           1.  go to the section expert (Report > Section expert)

           2.  select the Details section

           3.  insert two detail sections

                  Details a:  this section contains the fields from the Cust_conv_properties table

                  Details b:  this section contains  sr_BRAND

                  Details c:  this section contains sr_CATEGORY

           4.  Select the Details b section and add a formula to Suppress the section when [Cust_conv_properties.prop_value] <> “brand”

           5.  Select the Details c section and add a formula to Suppress the section when [Cust_conv_properties.prop_value] <> “category”

           6.  Close the Section Expert

           7.  Insert your subreports in section Details a and Details b