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

FRX to HTML - what are the options? 2

Status
Not open for further replies.

Stella740pl

Programmer
Jul 3, 2003
2,657
US

Hello everyone!

We have a number of reports that we usually print out, send the data to Excel, and also save to PDF using Acrobat Distiller.

We don't distribute the applications, it is for in-house use only. We distribute, in this case, ready reports in the formats mentioned above.

I should also mention that we have VFP6, and the management doesn't have any plans to upgrade any time soon.

Recently, we got a request to output the reports, with all the formatting (not data only) to HTML. It should be done in a fairly simple and quick way (no massive rewrites).

Search shows that many people recommend using 3rd party applications, like XFRX or FRX2ANY. While we might consider that eventually, there are also questions of legality of using those for business needs, licensing, cost, speed of approval paperwork, etc.

So the preferred method, for now, would be something built in VFP6.

I found that _frx2html class exists (and dropped it on the project), but I am not sure how does this work, since I've never used it before, and didn’t find good examples on using it. Can someone please show a code sample on using this class and comment on possible pitfalls or quality of the output?

At the same time, report preview seems to have an option Save as HTML, which looks like an ideal solution for our needs - if it wasn't disabled at all times. What appears to be the problem? How to make this work?

I would appreciate your answers, suggestions and comments.
Thanks.
Stella
 
Look at the VFP 3rd party utility XFRX
It sends the report to a listener file and from that file you can create a WORD.DOC , EXCEL.XLS , PDF , TEXT ,HTML , etc...) with only running the report once.


David W. Grewe Dave
 

Listener? Isn't it VFP9 (or am I confusing something)? We use VFP6.

As for XFRX, is it free or how much does it cost? Can it be used for business needs? How many licenses a group of several people may need?

I still would prefer to make VFP's own tools work. Did you try _frx2htm class? Have you ever tried File->Save as HTML menu option in report preview? Mine, for some reason, looks disabled.

 
Stella,

It might sound long-winded, but I would suggest that you create a program or class method that can take a cursor and create and html page out of it.

VFP is great at string manipulation, which of course is all that an html file is, and I create several different html pages for our Intranet this way.

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
As for XFRX, is it free or how much does it cost? Can it be used for business needs? How many licenses a group of several people may need?"

You can check XFRX out here:

$339USD for all the converters and you can distribute wtih all your applications.

I use it and like it a lot, especially for PDF's

Ed
 

Thanks for the replies.

mgagnon, I checked and tried your FAQ (and another one on the same topic) before I posted. Even had to change a thing or two, because they didn't work in our VFP6 as is. It sends a raw table to a very raw HTML - and, as I mentioned, we need to preserve all the report formatting, and do it fast. Stewart, same thing applies. Besides, while a class or program may take care of a table, wouldn't it need some special coding to take care of each report's special formatting, lines, calculated columns, print-when conditions (e.g. 999.99 % format with some values and just n/a with some others), report variables, group footers, summaries, etc.?

While I might get to it one day, with some new development (and my HTML is not good at all as of now), right now no one will wait while I rewrite a dozen of working formatted reports with lots of report variables, formatting lines, etc. and debug it to the same level of reliability as those we already have. As far as management and customers concerned, we already have those reports working - and looking - the way they want them; we distill them to PDF already, and the only thing we need now is to save to HTML.

No one will understand a need to spend days on that, both now and with every new report created.

eandres, I heard of that one (and also FRX2ANY), I didn't really research on it yet. We already have Acrobat Distiller to convert to PDF. The management might be willing to consider third parties if there is a real need for it - and I can show that there is no way to do it in VFP. For now, the request was to look into VFP6 own tools first and foremost - and they do know of "Save as HTML" menu option, and ask why it is greyed out.

I assume, no one really tried using _frx2htm class?

Or can someone please help solving the mystery of File->Save as HTML menu option being there in Preview mode, but disabled at all times? Did anyone make it work? What does it take?

 
Hi Stella,

There is a free VFP6 SP3 class written by John Koziol and updated by Fábio Vieira that you can try as another option.
FRX2Word emulates the function of the Visual FoxPro REPORT FORM command using Word automation to create .DOC, .RTF, and/or .HTML files. What it does not do is create an exact duplicate of the printed reports. Due to differences in the way that coordinates are measured in Word and the Visual FoxPro Report Designer, an exact pixel-by-pixel duplicate is almost impossible.

What are created are files that respect the intent of the report file. Titles, headers, and footers will be placed almost exactly where they are placed in the Visual FoxPro printed report. The differences in the Visual FoxPro report and the Word files are that group header, footer, and the detail band counts may vary page-by-page. The Word documents will have slightly fewer of these bands per page but no bands are lost and the placement of items within each band is exactly as in the VFP reports.
I have not tried it but I hope it works for you as desired. You can download it here.
 
I can't comment on the _frx2html class, so if that's all you're looking at, you can ignore the rest of this comment. [smile]

See the thing is, unless I'm mistaken, earlier versions of VFP created output as what amounts to a bitmap. Then the printer driver would either display it or print it. It seems you would have to make the report print as ASCII and do your own HTML formatting.

Just a suggestion, but if you do end up spending the $399 for XFRX, you may as well upgrade to VFP 9 where you can use the report listener. It does a swell job of sending reports to HTML, with very little extra work. You may have to tweak the report formatting a little, but it is worth the trouble.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 

Thanks, Rambler.

I downloaded it to try out - but it would be really nice if the Help file was in English, since I don't know Spanish. (I will Google for the English version - it probably is there somewhere, I would guess.) I mean, I can't even get an idea what are the terms and conditions for business use, let alone technical details.

At the same time, I tried VFP's own GenHTML.prg. It is a good start - decimal positions are aligned, calculated fields and group bands are there in the formats needed, etc. But it still leaves much to be desired (formatting details, like lines, etc. are gone) and, most important thing, it doesn't find some object properties used to populate some group and summary bands (the object was created by SCATTER NAME from another, unrelated table and is used as m.theName.theProperty).

I will see what I can do with either one: if that class can be legally used for our needs (since it is also a third party solution) and what it does; and if I can adjust GenHTML.prg.

A mystery of disabled "Save as HTML" option still bothers me a little, though.

 

Dave,

you may as well upgrade to VFP 9 where you can use the report listener. It does a swell job of sending reports to HTML, with very little extra work. You may have to tweak the report formatting a little, but it is worth the trouble.

Thanks!!!

I was trying to talk the higher-ups to get us VFP9 from the days before it came out. No luck. I finally gave up. This may, with some luck, be my best argument - will see next week.

On the other hand (yes, I am asking this again), why VFP6 has that "Save as HTML" option and why it is disabled? I suspect, though, that if enabled, it would run that same GenHTML.prg that I just tried out, but maybe from inside the preview it would see my objects. Or not.
 

Mike, thanks. That's a good piece of information, coupled with Dave's note on VFP9 doing a good job with converting reports. Will try to use that.
 
>it would be really nice if the Help file was in English
It is, see Frx2word.chm, also included in the zip file.

 

Oh. Sorry. I noticed the other .chm file included, Frx2word-br.chm (probably not Spanish, though, rather Brazilian Portugese?), but DIDN'T NOTICE the English version. Now that I took another look, I can see it. Must be tired. TGIF.
 

Some feedback so far.

Even though FoxPro's own GenHTML.prg couldn't see properties of an object created with SCATTER NAME (so it could not complete converting at least one of our reports), my boss was actually quite happy with the output it produced for some other reports so far. Not as much happy, rather glad that we have this quick and dirty method of converting into HTML with reasonably satisfactory output.

Rambler, that class you pointed me to is still up for evaluation when time permits (most likely, next week or so).

And the most pleasant thing so far, my boss took the news that VFP9 does a much better job very well, so he is planning (once again) to support my quest for VFP9 and talk to higher management about the upgrade, using this as an argument. Let's see.

I will try to keep you posted.
 

If you are already generating reports in Excel format and want to convert existing Excel reports to html format just add code to save your excel reports in html format.

eg:

loXL=GETOBJECT(',','Excel.Application')
loWB=loXL.workbooks.open('c:\temp\filename.xls')
lowb.SaveAs('c:\temp\filename.html',44)


 

mmm000,

Thanks. We don't really generate the reports in Excel; no automation is used for reporting either. We send just data - some of the fields from the underlying tables with simple COPY TO (attached to a command button) for those customers who request this format. (I sometimes lightly format the files by hand afterward, but those who need Excel format are happy to have the data only and do whatever they need with it themselves.)

Yes, we tried to save .XLS as HTML (just using the menu option in Excel). It comes out very pretty (if the Excel file is formatted), much nicer than from GenHTML.prg - but no group footers, summaries, data from other sources, etc., so much more time should be spent to make those. On the other hand, GenHTML-generated file loses some of the formatting, but preserves more data other than the columns from the main table. For now, that is the preferred way.

I was looking more for a way to preserve both without the need to rewrite/write much more extras. I will see how the class works and if we can get an upgrade to VFP9.
 

TheRambler,

I've tried the class you suggested (just finished a few minutes ago).
I was fighting with it since yesterday trying to make it work. After correcting some obvious errors (like specifying a path to the file it couldn't locate) and waiting for it to work for some significant amount of time (seemed like forever), there were some errors I didn't even understand. Like "This action cannot be completed because the other program is busy. Choose 'Switch to' to activate the busy program and correct the problem" when virtually no other application was open besides couple of instances of Windows Explorer. I closed those, too, and killed antivirus that decided that it has to start at that particular moment - didn't help. The Task Manager, though, showed that something was going on with Word, and that something took the whole CPU capacity. So I opened Word manually, and it helped.

Anyway, it did some reasonably decent job with our simpler reports, and didn't support the more complicated features in others (like data coming from an object created by SCATTER NAME). In any case, thank you for the suggestion and the link, I will save it for later, in case I want to tweak it a little for some other projects later on. The code of the class is of interest to me, so I am going to study it more in depth when I have a chance. Star for you.

As for now, my boss looked at it and decided that even though this is not so bad (not great, either), we are not going to go this route now and try to improve this class, or the one supplied with VFP; neither we will write our own tools.

He said that he prefers an output created by saving .XLS as HTML much better, even though this would require some formatting of the Excel file and adding summaries, footers, and calculated fields to it prior to converting. So that's what we are going to do for now. Maybe we will automate it eventually, maybe not, since there are more pressing needs and more interesting/urgent projects now to take care of.

Thank you everyone for the suggestions and for helping me explore my options.

 
Thanks for the star Stella. I just wanted to add some things Fabio Vieira wrote in a Brazilian fox forum:

I don't want to defend this class, because it may be good for some people and totally useless for others.

and from the help file:
FRX2Word is not the ideal tool for reports over 20 or 30 pages unless a Word file is absolutely required. If your requirements are greater, it's suggested that you look into a PDF writer

Still, Fabio offers to help:
The simplest and most efficient way to help is to specify the version of the class, FoxPro, Office and Windows, plus a succinct description of the problem. If that doesn't help, I may ask for a copy of the tables and report form, usually we find the origin of the problem.

You can find his e-mail address in the first page of the help file.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top