Home Component Writing

Reporting/rendering on HTML data

edited September 2002 in Component Writing
Does anyone have an idea on how to include HTML information in a report?
Note that I'm specifically talking about HTML as an input, not as an output
using something like TExtraDevices.

Here's our situation:

- We have a website which collects a bunch of data in a SQL Server database

- Our site collects a lot of comments/notes. We needed to support
formatting features (different font styles, colors, sizes; bullets;
numbering, etc.) As a result, we're using a third-party, rich text editor
tool called RichTextBox (I recommend it if you're doing any ASP.NET work).
The output from RichTextBox is HTML. We save the HTML in the database.
Everthing is wonderful as long as we're dealing with browsers.

- We're trying to figure out how to do reporting. There are some inherent
problems with doing reporting in a browser (headers, footers, page breaks,
etc). As a result, we'd like to use a real reporting tool. We've used
ReportBuilder for a lot of Delphi work in the past. I'd love to be able to
use it for our current need. My problem is that I can't figure out a good
way of including our HTML-formatted comments in the report.

Here are a few things I've considered:

1. Convert HTML => rich text on the fly and use RBuilder's built-in rich
text control. Problems with this approach:
- So far, I haven't been able to find any really good converters
- I'm concerned that this wouldn't work well under stress in a web server
environment

2. Use THtmlViewer (www.pbear.com) to render the HTML, convert it to a
bitmap (using a built-in THtmlViewer method) and load the bitmap into
RBuilder's native image control. Problem with this approach:
- Some notes/comments may be very long and may spill across pages.
RBuilder doesn't appear to have the ability to break large images across
pages.

3. Custom component - I've wondered if it would be possible to subclass
THtmlViewer so that it would work in RBuilder. Such a component would have
to have many of the attributes of a memo/richtext control (IOW, it would
need to be able to stretch and work across page breaks). Problem with this
approach:
- I don't even know if this is really possible.

If anyone has any ideas on how to solve the problem, I'd appreciate it.


Brian H.

Comments

  • edited September 2002
    The image approach is most likely the one that you can get working first.
    Create a JIT pipeline to return the records. The JIT pipeline can return
    images. If you do have images which may fit over multiple pages, then you
    might be able to do this by creating multiple field objects to print the
    images as they break over pages. You can always create an offscreen bitmap
    and measure it to see how many bitmaps you need to break it up into. Once
    you break the image up into multiple bitmaps objects, you can feed them to
    the report through individual fields through the JIT pipeline. There will
    need to be ShiftRelativeTo TppDBImage components in the detail band of the
    report in order to print them in a single detail band. The other alternative
    it to print them as individual records through one single field in the
    pipeline using a single TppDBImage component in the detail band.

    As for a converter, I searched google and download.com and came up with
    http://www.khsd.com/products.asp Don't know if it can convert html to rtf,
    but it might.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.