Question

I have a section in a Crystal Report that I want to suppress. I need to suppress it if there are 0 rows in a particular table in the dataset I am using. How would I do this? The Record Number special field provided appears to be an internal count of records in the report, and does not relate to the rows in the underlying data table.

I am creating the report from C#, but I cannot suppress the section from the code (it doesn't fit the project structure) - I must be able to do it from the report itself. The table concerned is definitely being passed to the report in the dataset, but it contains 0 rows. There must be a way to establish this inside the report itself.....

Can anyone please point me in the right direction?

Was it helpful?

Solution

In the Crystal Reports designer, view the properties of your section and there should be an option to Suppress, which you can give it a formula to return the appropriate boolean value.

You could then use the Count() function within that formula and (I believe) you can pass the name of your dataset to the Count() function to get the number of rows in that dataset.

I did the same thing on a complex report about 3 months ago but I don't have access to the report any more having changed jobs so I'm sorry I cannot be more specific, but hoepfully this gives you a starting point.

Just had a quick Google - try this.

OTHER TIPS

If the section does only contain database fields and f.e. no text fields, then you could use the setting "Suppress Blank Section" in the "Section Export" (rightclick section) for that section.

As an alternative you could use the following formula in the "Suppress" in the "Section Export" for that section:

IsNull({table.field})

"{table.field}" is one of the fields in the dataset.

Hope this helps.

Go to "Section Expert" and click "Supress (No Drill-Down)" and try adding this:

IF {"DragYourFieldHere"} = "" then true else false

Create one dummy group,check on its header for each page,add the header in the group header of the dummy group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top