[基本問題]請問pascal如何匯出word, Excel跟html,另請各位給我program一點建議 |
答題得分者是:christie
|
mahoihei
一般會員 發表:6 回覆:6 積分:2 註冊:2009-08-10 發送簡訊給我 |
怎可以做到??
另外附上本人的公開試上呈的東西,請大家給點建議,這是一個電話簿 | |||||
christie
資深會員 發表:30 回覆:299 積分:475 註冊:2005-03-25 發送簡訊給我 |
Delphi匯出html:
function ListViewConfHTML(Listview:TListview; output:string; center: Boolean) : Boolean; var i,f: Integer; tfile: TextFile; begin try ForceDirectories(ExtractFilePath(output)); AssignFile(tfile,output); ReWrite(tfile); WriteLn(tfile,'<html>'); WriteLn(tfile,'<head>'); WriteLn(tfile,'<title>HTML-Ansicht: ' listview.Name '</title>'); WriteLn(tfile,'</head>'); WriteLn(tfile,'
WriteLn(tfile,'</html>'); CloseFile(tfile); Result := True; except Result := False; end; end; procedure TForm1.FormCreate(Sender: TObject); const Names: array[0..5, 0..1] of string = ( ('Rubble', 'Barney'), ('Michael', 'Johnson'), ('Bunny', 'Bugs'), ('Silver', 'HiHo'), ('Simpson', 'Bart'), ('Squirrel', 'Rocky') ); var I: Integer; NewColumn: TListColumn; ListItem : TListItem; begin with ListView1 do begin Parent := Self; //Align := alClient; ViewStyle := vsReport; NewColumn := Columns.Add; NewColumn.Caption := 'Last'; NewColumn := Columns.Add; NewColumn.Caption := 'First'; for I := Low(Names) to High(Names) do begin ListItem := Items.Add; ListItem.Caption := Names[I][0]; ListItem.SubItems.Add(Names[I][1]); end; end end; procedure TForm1.Button1Click(Sender: TObject); begin if ListViewConfHTML(ListView1,'d:\text.html', true) then ShowMessage('OK/ html') else ShowMessage('Error occured/ html'); end; ===================引 用 mahoihei 文 章=================== 怎可以做到?? 另外附上本人的公開試上呈的東西,請大家給點建議,這是一個電話簿
------
What do we live for if not to make life less difficult for each other? |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |