Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Ken Murphy
 To: david higgins
  Where is david higgins?
 gig harbor
 Washington - United States
 david higgins
Subject: RE: Changing field names in multiple reports
Thread ID: 155069 Message ID: 155070 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Monday, December 24, 2007 4:54:06 AM         

> Greetings,
> Is there a quick way to change specific field names in a report?
> I realize that I can do this manually, but it would take quite a while, since I need to change multiple fields in multiple reports.
> In one of my applications, I have a large number of reports, each with a large number of fields. I would like to copy my old reports to my new application (so I don't have to recreate the reports), but will need the field names to change so that the field names in the new reports match the new data file in the new application.
> For example, let's assume that I have a SALES application and want to use 10 of my SALES reports for an INVENTORY application. Let us also assume that I have 20 different field names in each of these reports that would need to be changed. To make the fields easier to differentiate, I have labeled the field names as follows:
> Sales Reports - should be changed to - Inventory Reports
> ----------------------------------------------------------------
> - SalesField01 - should be changed to - InventoryField01
> - SalesField02 - should be changed to - InventoryField02
> - SalesField03 - should be changed to - InventoryField03
> - SalesField04 - should be changed to - InventoryField04
> - SalesField05 - should be changed to - InventoryField05
> - -through-
> - SalesField20 - should be changed to - InventoryField20
> Any suggestions will be greatly appreciated.
> Thanks,
> David Higgins


One of the great things about VFP is that just about everything is stored in a VFP table - including each of those reports. Try this:


You can open your reports just as you would a table. Take a look at the "Name" and "Expr" fields. Not only can you open a report as a table, you can also use the REPLACE command - for example:
REPLACE ALL Expr WITH Inventory.Field01 FOR ALLTRIM(Expr) == "Sales.Field1"

Give it a bit of a play and see what you come up with.

You shall know the truth - and the truth shall set you free. (John 8:33)


Changing field names in multiple reports Posted by david higgins @ 12/24/2007 2:07:04 AM
RE: Changing field names in multiple reports Posted by Ken Murphy @ 12/24/2007 4:54:06 AM
RE: Changing field names in multiple reports Posted by Don Higgins @ 12/24/2007 6:18:04 AM
RE: Changing field names in multiple reports Posted by venkataramesh cheruvu @ 12/31/2007 7:31:39 PM
RE: Changing field names in multiple reports Posted by Barbara Peisch @ 12/31/2007 8:27:07 PM