太慢了
这么说吧 用了最简单的东东
数据集的SQL用了
SELECT '' AS 部门,'' AS 工序,'' AS 人员,'' AS 工时
然后建个 数据网格表单文档。(当然采用了刚才的数据集)
然后新建个功能,主窗体引用了这个表单文档。
然后上面拖了个 ExcelToTable 和一个DataSetBroker
ExcelToTable的DataSource属性指向了DataSetBroker
DataSetBroker的InfoBroker指向了 系统自动生成的InfoBroker
DataSetID 选择了唯一的数据集 就是上头创建的
然后拖个按钮
按钮的单击事件代码如下
procedure TMainForm.Button1Click(Sender: TObject);
var
openDialog: TOpenDialog;
fileName,msg: string;
begin
openDialog := TOpenDialog.Create(nil);
if openDialog.Execute then
begin
fileName := openDialog.FileName;
if fileName<>'' then
begin
excelToTable1.FileName := fileName;
excelToTable1.StartRow := 0;
exceltoTable1.EndRow:=200;
exceltoTable1.Execute(msg);
end;
end;
end;
这应该是最简单的使用了吧,复杂的我也不会。给看看哪的问题。 |