Einzelnen Beitrag anzeigen

Benutzerbild von MrSpock
MrSpock
(Co-Admin)

Registriert seit: 7. Jun 2002
Ort: Owingen
5.865 Beiträge
 
Delphi 2010 Professional
 
#19

AW: MyBase | Daten zur Tabelle hinzufügen und in der Tabelle suchen

  Alt 25. Okt 2013, 07:36
Fastreport kann auch nach Excel exportieren. Die günstigste Version kosten 79 US$. Aber wie gesagt, du kannst es auch "händisch" machen, z.B. so ähnlich wie:

Delphi-Quellcode:
procedure TForm1.Button4Click(Sender: TObject);
var
  LCID : Integer;
begin
   LCID := LOCALE_USER_DEFAULT;

   try
      ExcelApplication1.Visible[LCID] := True;
      ExcelApplication1.Workbooks.Open('C:\Lokal\ClientDSExcel.xls',
        EmptyParam, // UpdateLinks: OleVariant
        EmptyParam, // ReadOnly: OleVariant
        EmptyParam, // Format: OleVariant
        EmptyParam, // Password: OleVariant
        EmptyParam, // WriteResPassword: OleVariant
        EmptyParam, // IgnoreReadOnlyRecommended: OleVariant
        EmptyParam, // Orign: OleVariant
        EmptyParam, // Delimiter: OleVariant
        EmptyParam, // Editable: OleVariant
        EmptyParam, // Notify: OleVariant
        EmptyParam, // Converter: OleVariant
        EmptyParam, // AddToMru: OleVariant
        EmptyParam, // Local: OleVariant
        EmptyParam, // CorruptLoad: OleVariant
        LCID);
      ExcelWorksheet1.ConnectTo(ExcelApplication1.ActiveSheet as _Worksheet);
      ExcelApplication1.Range['A1','A1'].Select;
      ExcelApplication1.ActiveCell.Value2 := ClientDataSet1ID.Value;
      ExcelApplication1.Range['B1','B1'].Select;
      ExcelApplication1.ActiveCell.Value2 := ClientDataSet1Name.Value;
   except

   end;
end;
Albert
Live long and prosper


MrSpock
  Mit Zitat antworten Zitat