停车场收费系统代码源程序

来源:誉澄智能 2012/7/2 11:33:08      点击:
   if Application.MessageBox('操作前请确认是否安装了Excel,如未安装请取消','提示',MB_OKCANCEL) <> IDOK then Exit;
    ExcelApp := CreateOleObject('Excel.Application');
    ExcelApp.visible := true;
    ExcelApp.Caption := '人事信息导出';
    ExcelApp.WorkBooks.Add(1);
    ExcelApp.WorkBooks[1].WorkSheets[1].Name := '持卡人信息';
    ExcelApp.Cells.Item[1,1] := '持卡人信息';
    for row := 0 to lvCard.Items.Count - 1 do
    begin
        ExcelApp.Cells.Item[row+3, 1] := lvCard.Items[row].Caption;
        for col := 0 to lvCard.Columns.Count -2 do
            ExcelApp.Cells.Item[row+3, col+2] := lvCard.Items[row].SubItems[col];
    end;
    for col := 0 to lvCard.Columns.Count -1 do
        ExcelApp.Cells.Item[2, col+1] := lvCard.Column[col].Caption;