Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count bolded fields, which are strings

Status
Not open for further replies.

asbach

Technical User
Jun 15, 2005
10
FI
Hi guys!

I am using Crystal Reports 10 with SQL 7.0 and I am lost.

I have a subreport and I have bolded a stringed field (Left({table.field1}, 1) & Left({table.field2, 2). Result is on detail section: VPU JRI MIL RHA

If my condition matches, then the field is bolded. That is not a problem. Result then could be: VPU JRI MIL RHA

But how on earth I could count only "crRegular", unbolded fields, when such exists in this subreport and return only count of "crRegulars" to main report?

I have set count, which now counts all fields and return this count to mainreport.

Thanks in advance!

- Asbach
 
Hi,
One Way maybe:

Create a formula for each field in the sub that you are interested in determining the non-bold status of( Using the same test you use to bold when appropriate)..Instead of applying this to the font attribute have it evaluate to 1 if the test is NOT met ( therefore no bolding ) add those formulas together and return the sum to the main report.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If you're doing it in a subreport, use Shared Variables to return the value for accumulation in the main report.

Something like
Code:
whileprintingrecords;
shared numbervar CountIt;
CountIt:={#TotCount};
CountIt
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared numbervar CountIt;
CountIt

Note that the shared variable is only available in the section after the section which contains the subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top