Quick Report : HTML Export Filter Add-on
Features
The Quick Report Professional HTML Export filter add–on provides a new filter class and four new controls which together allow the production of HTML documents suitable for web publication.
Version 1.1 features -
- Multipage documents supported.
- A background image or colour can be specified.
- Text position, size, face, colour and background is reproduced.
- Graphics are reproduced. QRGrImage controls save their pictures once, QRGrDBImage controls save their images on every record.
- Horizontal lines may be inserted with the QRHRule component.
- Hyper-text links may be inserted using the QRHTMLLabel component.
Classes
The document filter class
Controls
QRGrImage
QRGrDBImage
QRHTMLLabel
QRHRule
Example
Notes
Installation
© Alan Lochert&QBSS 2001
TQRGHTMLDocumentFilter
This filter class accepts output from standard TQRLabel and TQRDBText components, as well as the HTML components.
Properties :
TransparentTextBG : boolean Forces all text items to have transparent backgrounds.
PictureDir : string Directory for graphic files saved.
PictureDir : string Directory for graphic files saved.
PictureDir : string Directory for graphic files saved.
PageLinks : boolean Switches on links to previous and next pages.
Methods:
Create( Filename : string);
Params:
Filename : string the name of the HTML file.
SetHTMLBody( bodycolor : TColor; BGPicture : String; Extra : string );
Params :
BodyColor : TColor – the background color of the HTML page.
BGPicture : string – the file name of the graphic background graphic.
Extra : string – add additional HTML specifiers to go in the <BODY … tag.
Example
procedure TForm1.BitBtn1Click(Sender: TObject);
var
aHTMLFilt : TQRHTMLDocumentFilter;
begin
table1.open;
aHTMLFilt := TQRHTMLDocumentFilter.Create('Fish Report.html');
aHTMLFilt.SetHTMLBody( clAqua, 'web pics\pine.gif', 'alink="red"' );
aHTMLFilt.TransparentTextBG := true;
aHTMLFilt.PictureDir := 'Web pics';
Form2.QuickRep1.ExportToFilter( aHTMLFilt );
table1.close;
aHTMLFilt.free;
end;
See this export in the browser.
TQRHTMLLabel
Use this control to put hyper-text links into HTML documents.
The control has all the properties and methods of TQRLabel and three additional ones,
LabelType see below
LinkText a string type that holds the extra link text.
ShowOnDocs set to 'false' to suppress printing of the label.
There are 3 label types,
ldHTTPJump generates <a href="link-text">Label text</a>
ldNameJump generates <a href"#link-text">Label-text</a>
ldNameLabel generates <a name="link-text">
In the above, Label-text is the ‘Text’ property and ‘Link-Text’ is the new LinkText property.
Example –
These settings will produce a hot link to the URL in the LinkText.
HTMLLabel2.LinkType := ldHTTPJump;
HTMLLabel2.Caption := ‘Home Page’;
HTMLLabel2.LinkText := ‘www.qusoft.com’;
It takes two labels to set up a jump on the same page -
// this label is the jump
HTMLLabel3.LinkType := ldNameJump;
HTMLLabel3.Caption := ‘Go to top of page’;
HTMLLabel3.LinkText := ‘pagetop’;
// this label is the jump target
HTMLLabel4.LinkType := ldNameLabel;
HTMLLabel4.ShowOnDocs := false;
HTMLLabel4.Caption := ‘this text will not be printed’;
HTMLLabel4.LinkText := ‘pagetop’;
TQRHRule
Use this control to put HTML style horizontal rules into documents.
This control draws in the normal way in the preview and the printer but exports ONLY TO THE NEW HTML Export filter.
You may set the height, length and colour of the rule using the width, Brush.width, and brush.color properties - as with TQRShape.
The default height is 1 pixel and the default width is 100 pixels.
TQRGrImage and TQRGrDBImage
Use these controls instead of the standard ones if you want their images to appear on HTML exports,
They are the same in every way as the standard QR Image controls except that they export their pictures to the new HTML document filter.
They do not attempt to export to other filters so are safe to use at any time.
Installation
Files -
QRHTMLExp.DPK
grimgctrl.dcu
grimgctrl.dcr
qrwebfilt.dcu
QRHTMLExp.BPL
Source code is not available.
Example illustrated.
The report in the preview window
The HTML export in the browser window.