Prohibit Crystal Reports section if there are no rows in datatable

I have a section in Crystal Report that I want to suppress. I need to suppress it if there are 0 rows in a specific table in the dataset that I use. How should I do it? The provided special field “Record Number” is an internal count of records in the report and does not apply to rows in the reference data table.

I am creating a report with C #, but I cannot suppress a section from the code (it does not correspond to the structure of the project) - I should be able to do this from the report itself. The corresponding table is, of course, passed to the report in the data set, but contains 0 rows. There must be a way to set this inside the report itself .....

Can someone point me in the right direction?

+3
source share
4 answers

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

Then you can use the Count () function inside this formula and (I suppose) 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 in a complex report about 3 months ago, but I don’t have access to a report that has already changed tasks, so I regret that I can not be more specific, but gladly it gives you a starting point.

Just had a quick google - try this .

+6

f.e. , " " " " ( ) .

"" " " :

IsNull({table.field})

"{table.field}" .

, .

+3

" " " ( )" :

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

, , .

0

Source: https://habr.com/ru/post/1733327/


All Articles