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!

Convert Reports?

Status
Not open for further replies.

Steve Meyerson

Programmer
Sep 17, 2020
318
US
My friend will be converting my app to another language (probably PHP to be accessible on the net). My app currently has over 40 reports to print the forms to pdf. Almost all use existing data.

Is there some way to convert my frx/frt files to some other form which can be read or converted so the programmer(s) don't have to completely rewrite them (cost, etc.)?

Steve
 
There are tools available that can output a VFP report as a PDF. XFRX is probably the best known. But they are designed to run from within VFP rather than on a web server, so I doubt if they will be of much use in this case.

As you probably know, the specification of each VFP report is held in a pair of files, with extensions FRX and FRT. Those files are ordinary VFP tables that you can open and read in VFP, just like a DBF. So it would be theoretically possible for a program to extract the details from those files and generate, say, PHP code that would produce the reports. But I can't see it being an easy program to write.

If you (or your friend) wants to follow that up, you can get more information about the structure of the FRX/FRT file from VFP Help topic, "Table Structures of Table Files (.dbc, .frx, .lbx, .mnx, .pjx, .scx, .vcx)". This points to a report that you can run to view the required information.

Keep in mind that the normal way for a PHP program to generate a report would be to produce the report in the form of HTML code for viewing in a web browser. As far as I know, PHP can't natively produce PDFs, but there are some utilities available that will do that. For example, the FPDF Library (at (I have never used it, so don't take that as a personal recommendation.)

The VFP report designer also has a "Save as HTML" feature (on the File menu). It might be worth exploring that, although as far as I can see it only produces a snapshot of the report rather than code that will load the data and render the report dynamically.

So, not much help I'm afraid. Perhaps someone else here will have some better ideas.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks, Mike. Your answer does help a lot because it sends me in a few directions which I will also share with the programmer if you don't mind.

Steve
 
If you run PHP on windows you can make use of COM and run some VFP COMServer which does the reports as is.

Chriss
 
Keep in mind that, in most VFP reporting situations, the report itself is only part of the story. You also need to worry about getting the data together for the report. That usually means running VFP and/or SQL code to create a cursor.

My point is that, even if you found some tool for converting an FRX file into PHP code, you would still need to translate the code that creates the cursor, and that would probably be a manual operation.

Just one more thing to worry about.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I think I get that, Mike. That's why I'm thinking I will recommend they create the reports (forms) from scratch. The best I could do for them is provide them the output of the report sets in pdf format.

Steve

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top