数剧库中的内容如何输出为到html和chm文件?(300分)

  • 主题发起人 主题发起人 qhx
  • 开始时间 开始时间
Q

qhx

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用dbtrees控件与数剧库连接.
数剧库有4个field:
id(number),parentid(number),name(string),memo(memo)
我想把一个子树的内容输出为html文件。
 
写文件一样的写,只是要写上html的格式
 
作一个html模版文件
 
这是DBtrees控件

unit DBTrees;

interface

uses ComCtrls, DB;

type

TTreeNodeInfo=record
Id:String;
ParentId:String;
end;

TDBTreeView=class(TTreeView)
private
fTable:TDataSet;
fId,fParentId,fName:string;
function AddItem:TTreeNode;
function FindItem(Id:string):TTreeNode;
public
function GetId:string;
procedure BuildTree;
procedure ClearTree;
published
property FieldId:string Read fId Write fId;
property FieldParentId:string Read fParentId Write fParentId;
property FieldName:string Read fName Write fName;
property DataSource:TDataSet Read fTable Write fTable;
property ActiveId:string Read GetId;
end;

procedure Register;

implementation

function TDBTreeView.FindItem(Id:string):TTreeNode;
var i:integer;
NodeInfo:^TTreeNodeInfo;
begin
Result:=nil;
For i:=0 to Items.Count-1 do
begin
NodeInfo:=Items.Data;
If NodeInfo^.Id=Id then
begin
Result:=Items;
Exit;
end;
end;
end;

function TDBTreeView.GetId:string;
var NodeInfo:^TTreeNodeInfo;
begin
If Selected=nil then Result:=''
else
begin
NodeInfo:=Selected.Data;
Result:=NodeInfo^.Id;
end;
end;

function TDBTreeView.AddItem:TTreeNode;
var NodeInfo:^TTreeNodeInfo;
BMark:TBookMark;
ObjParent:TTreeNode;
Name,CurId:string;
begin
ObjParent:=FindItem(fTable.FieldByName(fId).AsString);
If ObjParent<>nil then
{钺?牝 箧?漕徉怆屙 ?溴疱忸}
begin
Result:=ObjParent;
Exit;
end
else
{漕徉怆
 
没人回答?
 
后退
顶部