Hi, Delpher,
wie kann ich mit folgendem Code verschiedene DBGrids (z.B. DBGrid1, DBGrid3, DBGrid4 ..) übergeben?
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| procedure TForm1.ExcelxClick(Sender: TObject); begin fname := concat(label30.caption, 'OUTXLS\' + TQuery(TDBGrid(TPopupMenu(TMenuItem(sender).GetParentComponent).popupComponent).Datasource.Dataset).Name + '.xls'); if Excel_vorhanden then begin if fileexists(fname) then excelstart(self); if not fileexists(fname) or exneu then begin screen.Cursor := crHourGlass; Excel_Layout1(self); Qx2Excel(TQuery(TDBGrid(TPopupMenu(TMenuItem(sender).GetParentComponent).popupComponent).Datasource.DataSet)); excel.activeworkbook.saveas(fname); screen.Cursor := crDefault; end; excel.visible := true; end; end; |
Danke für Hilfe / Aufklärung,
Detlef