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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FRX objtype=8 and objtype=5 relationship 2

Status
Not open for further replies.

Ljupce Zagorac

IS-IT--Management
Nov 28, 2018
13
US
Hi guys,

Has anybody figured out how to relate values in expr fields for FRX field name (objtype 8) and it's appropriate label (objtype 5).
For example objtype 8 expr='inv_no' and objtype 5 expr='Invoice Number'.
This can be helpful when exporting to Excel to show labels rather than field names.
My walk-around is to populate FRX field comment with "Invoice Number" for objtype 8 expr='inv_no'.
Any more elegant solution please?


 
You can achieve something similar by using the Caption property within your table (the table must be part of a database for this to work; not a free table). Open the table exclusively, do MODIFY STRUCTURE, and set the Caption of the relevant field. For example, if the field is inv_no, you would set the caption to Invoice Number.

Now go to the Report Designer. Either add the table to the report's Data Environment, or open a project or database design window that contains the table. Either way, drag the field from the table and drop it on the repot.

You should now see two objects in the report: the label, which is set to Invoice Number; and the expression, which is inv_no,

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike, but I have to stay on free tables bulk created on fly.
 
No reason why you can't create a free table that isn't really free, create it and attach it to a database by the same name, then modify the database properties in code.

You could easily encapsulate the adding to a dbc, with a simple udf, and do something readable for the database properties...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
You don't need to create anything on the fly. You only need the database at design-time. It's not relevant when running your report.

Do this:

1. Create a new database in a temp folder.

2. Copy your table (and any indexes and memo files) to that folder. Be sure not to change its name. It doesn't matter what data is in the table.

3. Add the table to the database.

4. Add the captions to the table.

5. Open the report designer. Drag your fields from the table to the report. Save the report and close the report designer.

6. Delete the database and the copy of the table.

Remember, the whole point of this exercise is to save you time when laying out the report. Once you've done that, you don't need the database any more. You don't need it at run time, and it doesn't matter what data is in the table when you create the report.

Of course, whether this procedure will actually save you time or not is another matter.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Of course Mike, you are right, you only need the database and the caption to create the report, the database doesn't need to exist to run it - just a suitable cursor.


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top