Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   TAdvStringGrid, Excel-Export, Excel 2010 ungültige Zeichen (https://www.delphipraxis.net/177549-tadvstringgrid-excel-export-excel-2010-ungueltige-zeichen.html)

hoika 13. Nov 2013 07:12

TAdvStringGrid, Excel-Export, Excel 2010 ungültige Zeichen
 
Hallo #,

ich benutze TAdvGridExcelIO zum Exportieren eines TAdvStringGrids.
Klappt bis Excel 2007 auch ganz gut.
Jetzt habe ich hier Excel 2010 und Excel meckert, dass ungültige Zeichen
in der Datei gefunden worden sind, die repariert werden müssen,
danach steht in Datumsfeldern eine 5-stellige Zahl.
Formatiere ich die Zelle in Excel jetzt als Datum,
zeigt er alles korrekt an.

Im Netz habe ich Infos zu OnCellFormat gefunden:

Delphi-Quellcode:
procedure TForm1.AdvGridExcelIO1CellFormat(
  Sender: TAdvStringGrid;
  const GridCol, GridRow, XlsCol, XlsRow: Integer; const Value: WideString;
  var Format: TFlxFormat);
var
  tdtDummy : TDateTime;
begin
  if TryStrToDate(Value, tdtDummy) then
  begin
    Format.Format := 'TT.MM.JJJJ';
  end;
end;
Laut Internet soll man das englische Format nehmen,
aber sämtliche Versuche ("dd.mm.yyyy", "mm/dd/yyyy") resultieren in die gleiche (obige) Fehlermeldung.

Was z.T. (zum Teufel ;) ) muss ich hier angeben ???


#Update:
Delphi-Quellcode:
AdvGridExcelIO.Options.ExportCellFormats := False;
Damit wird zwar trotzdem eine Fehlermeldung angezeigt,
aber das Datum wird korrekt angezeigt.


Danke


Heiko


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:27 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz