Autor Beitrag
dragon77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 11.12.05 19:34 
Hallo,

ich habe ein SaveDialog (JEDI-Komp.)
Dieser Dialog wird zum Exportieren einer DBListView genommen.
Nun möchte ich das man zwischen 3 Verschiedenen Formaten auswählen kann.

Mein Bisheriger code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
saveEx.Filter := 'CSV-Datei (*.csv)|*.CSV|Excel-Datei (*.xls)|*.XLS|HTML-Datei (*.html)|*.HTML';
      saveEx.Title := 'Liste Exportieren';
      if SaveEx.Execute then begin
           // hier müsste die Auswertung hin welches Format gewünscht ist.
          DBAdvListView1.SaveToCSV(saveEx.FileName + '.csv');
      if (anderes Format)...
       ...
       ...

Wie kann ich jetzt auswerten welches Format der User im Dialog ausgewählt hat?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 11.12.05 19:45 
Die Eigenschaft, die du suchst, ist savedialog1.FilterIndex.

_________________
We are, we were and will not be.
dragon77 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 11.12.05 20:23 
Hab es damit auch schon Probiert. Hat aber leider nicht geklappt.
Waldheini
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 32

Win 98SE, XP
D5 St., K3 Prof
BeitragVerfasst: So 11.12.05 22:53 
Sollte es aber:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
If SaveEx.FilterIndex = 1 then  // wenn .csv Index 1 hat
   begin
      // deine Anweisung für .csv
   end
else if SaveEx.FilterIndex = 2 then  // wenn .xls Index 2 hat
   begin
      // deine Anweisung für .xls
   end
u.s.w.


Dabei mußt Du aber wissen, welcher Filter welchen Index hat, also an welcher Stelle Du den Filter eingegeben hast.
dragon77 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 13.12.05 10:58 
Ja, danke hab es hinbekommen. Thanks.