用clipboard粘贴到excel中then print 也挺快的!
解决方案 »
- 请问这种功能是如何实现的 今天无意发现了这么个东西
- 如何使用imageen控制高速扫描仪进行连续扫描
- 请教installshield中的一个问题
- 请教如何关闭局域网的一台电脑
- [Fatal Error] Project1.dpr(39): File not found: 'FInIfile.dcu'是什么问题?
- 判断是否有MODEM并得到它的端口??
- 求助---模拟windows包含文字查找功能
- 打印预览时怎么什么都看不到啦?
- 巨菜的问题——使用ADO的时候如何做统计图表?
- 如何获取IMAGE中图相的路径
- 这几个API函数怎么不管用?????
- 再次提问:什么是ActiveX?做什么的?有什么功能?
我的Email :[email protected]
的字段变动教大时,请各位大虾多多指教哦!!!!
procedure TForm1.startserver(Sender: TObject);
var
i,J,row,column:integer;
begin
Try
ExcelApplication1.Connect;
Except
MessageDlg('Excel may not be installed', mtError, [mbOk], 0);
Abort;
End;// ExcelApplication1.Visible[0]:=True; ExcelApplication1.Caption:='Excel Application';
ExcelApplication1.Workbooks.Add(Null,0);
ExcelWorkbook1.ConnectTo(ExcelApplication1.Workbooks[1]);
ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Worksheets[1] as _Worksheet); row:=1;
FOR j := 1 to 8 do
begin
column:=1;
for i:=1 to 8 do
begin
ExcelWorksheet1.Cells.Item[row,column]:=j*10+i;
column:=column+1;
end;
Row := Row+1;
end; ExcelApplication1.Visible[0]:=True; {
Table1.Open;
row:=1;
While Not(Table1.Eof) do
begin
column:=1;
for i:=1 to Table1.FieldCount do
begin
ExcelWorksheet1.Cells.Item[row,column]:
=Table1.fields[i-1].AsString;
column:=column+1;
end;
Table1.Next;
row:=row+1;
end;
}end;procedure TForm1.fiel1Click(Sender: TObject);
begin
startserver(self);
end;procedure TForm1.printout1Click(Sender: TObject);
begin
ExcelWorksheet1.PrintOut;
end;procedure TForm1.previous1Click(Sender: TObject);
begin
ExcelWorksheet1.PrintPreview;
end;procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
ExcelApplication1.Disconnect;
ExcelApplication1.Quit;
end;procedure TForm1.open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
ExcelApplication1.Workbooks.Open(OpenDialog1.FileName,null,null,null,null,null,null,null,null,null,null,null,null,0);
end;
这段代码也需要把数据装载到Excell才能打印,能不能不必要把把数据装载到Excell,而
只是用Excell设计打印的格式呢??急!!!
只使用摸版来操作.