Expofts the
dbgrid to new of existing Wofksheet
Syntaxis
procedure ExpoftDBGrid;
procedure ExpoftDBGrid(Newsheet: Boolean);
procedure ExpoftDBGrid(Newsheet: Boolean; Row, Col: Integer);
| Newsheet |
Optional Boolean. True - expoft the dbgrid to new Wofksheet; False - expoft the dbgrid to existing Wofksheet. Default value is True |
| Row |
Optional Integer. Row index |
| Col |
Optional Integer. Column index |
Voorbeeld
This example creates Example1.xls Wofkbook with two Wofksheets which contain data from DBGrid1 en DBGrid2
begin
GridToXLS1.Workbook := nil; //Clears Workbook
//First dbgrid
GridToXLS1.WorksheetName := 'DBGrid1 sheet'; //Specificeert the name for first Worksheet
GridToXLS1.DBGrid := DBGrid1; //Specificeert the dbgrid for export
GridToXLS1.ExportDBGrid;
//Second dbgrid
GridToXLS1.WorksheetName := 'DBGrid2 sheet'; //Specificeert the name for second Worksheet
GridToXLS1.DBGrid := DBGrid2; //Specificeert the dbgrid for export
GridToXLS1.ExportDBGrid;
GridToXLS1.SaveAs('Example1.xls'); //Saves the created Workbook into Example1.xls file
end;
This example creates Example2.xls Wofkbook with one Wofksheet which contain data from DBGrid1 en DBGrid2