wingyip
wingyip

Reputation: 3536

Crystal Reports - Check for specific record in grouped detail records and suppress image in Group Header if present

Using Crystal Reports that is bundled with Visual Studio.Net 2003 in old .Net 1.1 app

I have an invoice report with detail records showing each item on the invoice. The report uses one dataset and Grouping for the detail records rather then a sub report.

Anyway in the main part of the invoice I have an image which needs to be visible if a certain detail record with id "PNP2" is present.

So I imagine that in the Format editor of the image Ole Object, I can write some code against the Suppress method that will do this - I think that somehow I need to loop the detail records to check each value but maybe there is a better way...

Can anyone help?

wing

Upvotes: 0

Views: 2170

Answers (1)

craig
craig

Reputation: 26262

This should work, assuming that the image is in the group-header section.

Create a formula:

// {@IS_PNP2}
If Not(Isnull({table.id})) And {table.id}="PNP2" Then 1 Else 0

Add the following to the image's conditional-suppression logic:

Sum({@IS_PNP2},{table.grouped_field})>0

Upvotes: 1

Related Questions