user1185830
user1185830

Reputation: 41

Is there a way to get field names in a crystal report programmatically?

I have some big reports. What I need is the list of 'displayed' column names - not the actual fields(that I know how to get). Is there a way to get that info programmatically? I need to get them so end user can decide what columns can be deleted. I am using crystal report 8.5. Thanks

Upvotes: 4

Views: 3406

Answers (1)

Ryan
Ryan

Reputation: 7287

This might be worth a shot. First, export the report's definition ('File' -> 'Export' -> 'Export Report' -> 'Format': Report Definition). That should kick out a text file with quite a bit of information about the report, including all the data fields referenced. You could write a simple script to parse the file and spit out all of these fields.

I've never tried this before, so your mileage may vary. One thing to think about is what you mean by "displayed" fields. Fields could not be directly displayed on the report, but be used to calculate formulas or summaries which are displayed. You'll need to think about this along with how your specific reports are written when writing your script.

Upvotes: 1

Related Questions