begin GetCursorPos(CurPost);//获得鼠标当前坐标 if (y<=17) and (x<=vCurRect.Right) then begin if button=mbright then begin PmTitle.Popup(CurPost.x,CurPost.y); end; end; end; //vCurRect该变量在DbGrid的DrawColumnCell事件中获得 {procedure TFrmOrderPost.DbgOrderPostDrawColumnCell(Sender: TObject;const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin vCurRect:=Rect;//vCurRect在实现部分定义 end;} 如何将几个DBGRID里的内容导入同一个EXCEL表中? 在软件实际制作中,为节省开发成本和开发周期,一些软件人员通常会吧DBGrid中的数据直接导出到Excel表中,而先前能看到的函数仅仅只能在WorkBook的一个Sheet中导入数据,不支持多Sheet!。
procedure CopyDbDataToExcel(Args: array of const); var iCount, jCount: Integer; XLApp: Variant; Sheet: Variant; I: Integer; begin Screen.Cursor := crHourGlass; if not VarIsEmpty(XLApp) then begin XLApp.DisplayAlerts := False; XLApp.Quit; VarClear(XLApp); end;