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 SkipVought 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
0
0
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
 

Thanks.

I did see his e-mail address in the Help file, but I am not sure I will write - at this point, at least.

There is no real problem. It's just my boss (and the clients, at the end) are not very happy with the look of the output (though it really isn't bad), and we decided that we have too much on our plates right now to invest time into improving it (or debugging what didn't work).

...it may be good for some people and totally useless for others
Exactly. It may still be useful to us some other time, so I will keep in mind that he offered help. I might still need it.

Although, we may eventually go the Excel automation road, since they like what Excel does so much, and many people currently use our Excel files (not complete reports, though, just the data copied to Excel and very lightly formatted). So if one day we create nicer Excel reports, we may accomplish two tasks at once with this step. Will see.

Well, there was a problem, to be exact, with one of the reports (18 pages long) that uses data from public object (as I mentioned above) in group footers and summary band.
Even though the Help file mentions that "Any expression that can be evaluated from the current data session or visible memory variables or object properties is supported", FRX2Word cannot find that data. My original report, debugger, etc. see the object, so it probably is still visible - but not to that class.

I know, since it says it is supported feature (I didn't think it was until I checked again this morning), it probably can be fixed. But we decided we are not going to do it right now, that's it, because we found what better suits the requirments at this stage.

And finally, "if your requirements are greater, it's suggested that you look into a PDF writer". We do - we use Acrobat Distiller for some time already, and like what we see, but they now want HTML, too, and want it to look just as pretty, as much as possible.

Thanks again.
 

Dave Summers,

A little follow-up for you.
My best-so-far argument for VFP9 (that it does a very good job of sending the reports to HTML) caused some excitement for a little while, then was forgotten, just as all previous ones, soon after another viable (and free) alternative was found - Save as HTML from Excel, as I mentioned above. Well, it never hurts to try...

 
Oh well. Better luck next time. [smile]

Just as an example to show you how easy it is to use, a data warehouse project I've been working on for a spell gives the users the option of using the traditional VFP REPORT FORM output, text file or HTML output. Here's a little bit of code on how I implemented it:

Code:
   DO CASE
   CASE THISFORM.optOutPut.VALUE = 1   &&... preview
      SET REPORTBEHAVIOR 80

   CASE THISFORM.optOutPut.VALUE = 2   &&... text file
      SET REPORTBEHAVIOR 80

   CASE THISFORM.optOutPut.VALUE = 3   &&... HTML
      SET REPORTBEHAVIOR 90
      LOCAL loHyperlink

      *...report name is stored in a table
      STORE ADDBS(GETENV('temp')) + ;
         ALLTRIM(reporttree.reportname) + ".HTML" ;
         TO cHTMLReportName

      loListener = .NULL.
      DO ReportOutput.APP WITH 5, loListener

      loListener.TargetFileName = (cHTMLReportName)
      loListener.QUIETMODE = .F.
      loListener.ALLOWMODALMESSAGES = .F.

ENDCASE

.
.
.

DO CASE
   CASE THISFORM.optOutPut.VALUE = 1   &&... preview
      REPORT FORM (cReportName) TO PRINTER PROMPT PREVIEW  ...
   
   CASE THISFORM.optOutPut.VALUE = 2   &&... text
      *... get text file name here 
      REPORT FORM (cReportName) TO FILE (cTextFile) ASCII ...

   CASE THISFORM.optOutPut.VALUE = 3   &&... HTML
      REPORT FORM (cReportName) OBJECT loListener ...

      loHyperlink = CREATEOBJECT("hyperlink")
      loHyperlink.NAVIGATETO(cHTMLReportName)

ENDCASE



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

Looks neat. I like it.
Why do you need to SET REPORTBEHAVIOR 80 for PREVIEW and ASCII options, though? Does VFP 9.0 do it differently?

Does the HTML option see all of the report variables, data from unrelated tables, puts all lines/borders/shapes in place?

And have you tried using object properties as data source (as a part of field expressions or in report variables)? If so, does the HTML option handle it well? That's the part that I had problems with when tried the class suggested by Rambler and VFP's own GenHTML.prg.

 
I use the REPORTBEHAVIOR 80 for those just because it's faster. One of the new features of VFP 9 is the ability to print 'Page X of N'. So what it does in a sense is pre-render the entire report internally, then re-renders the report to output. Basically, two passes.
Which is a nice feature if you need it, but it does take more processing time.

As for report variables and data from unrelated tables, those have all worked for me. You still use the report builder (MODIFY REPORT) to create your reports just as always. The output is just 'intercepted' by the report listener object to create an HTML file instead of sending it to the printer or screen.
Borders, shapes, images, ... Those turn out fine. Some I have had to twiddle with a bit, but that is usually because of browser default fonts, spacing and so on - versus printable area on paper.

I haven't used object properties in reports to date, so I can't vouch for the listener to handle them. But I haven't had any problems with other public or report variables. In fact, I use a lot of them.



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

Thanks a lot. Very useful information. Here is a star for you.

But I haven't had any problems with other public or report variables. In fact, I use a lot of them.
So do I, and also haven't had any problems with them.
Just with the object properties so far. And only when trying to convert to HTML.

I think, SCATTER MEMVAR would work for me much better (issued before the report, in order to utilize the data) than SCATTER NAME, for the purposes of using one of those HTML classes. Have to try to confirm, though - when time permits.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top