Print Page | Close Window

Extracting Field Names

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21520
Printed Date: 04 May 2024 at 2:50pm


Topic: Extracting Field Names
Posted By: kurt
Subject: Extracting Field Names
Date Posted: 04 Jun 2015 at 6:54am
I have a report in CR 2011 and I want to use the actual field names (not the value) in the report.

I have messed around with formulas but am unable to actually put the name of the field on the report.

Any thoughts?

Thanks
Kurt



Replies:
Posted By: kevlray
Date Posted: 04 Jun 2015 at 7:03am
I have never seen it done.  Of course when you drop a field into the detail of the report.  A label is created with the field name.  You may be able to so something inside of a command.  But never had a reason to do so.


Posted By: kurt
Date Posted: 04 Jun 2015 at 7:20am
Thanks, I can think of some applications for this. Sort of word merge type stuff. Inserting the field name in a comment or something.

Maybe someone will come up with a solution.


Posted By: kevlray
Date Posted: 04 Jun 2015 at 12:39pm
Word merge?!? Crystal Reports by-passes the Word merge process.  I have taken the text from Word documents, pasted it into a text box.  Added the fields the fields I needed.  Added any parameters and I was done.


Posted By: kurt
Date Posted: 05 Jun 2015 at 1:55am
I was referring to the way word merge works, not that I wanted to do word merge.

For example:

This document contains a summary of <fieldname> and <fieldname>. They are the primary....


Posted By: DBlank
Date Posted: 05 Jun 2015 at 3:50am
I do not know of a way to do this but I also am not clear on the value added here of this "label insert" vs. just typing in the field name. Each report will have a different data structure and if it doesn't then hardcoding the text (typing the name in) works the same as the process you are requesting. Also, quite frequently data column headers are not what you want to display to the end user but rather a less technical or agency-centric vocabulary.
 
What are we missing? If we understood that perhaps a different solution would present itself...


Posted By: kurt
Date Posted: 05 Jun 2015 at 7:36am
Because at runtime, the field name may be different in our application. The data source is created using a SQL stored procedure which concatenates the table name and the field value.

The list of fields is dynamic and modifiable by the end user. So when the report runs is the only time I know what the field name is.

And at a technical level it is not a field name, but because the data source is created using a stored procedure, CR thinks it is a field.



Posted By: kevlray
Date Posted: 05 Jun 2015 at 1:27pm
From what I recall Crystal does not do dynamic field naming.  I seem to remember a similar question some years ago.  I think building some sort of temp table that gets built at run time where the temp table field names are stable, you just have to plug in the values from your data source.



Print Page | Close Window