Autor Beitrag
Tabakbrummel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Mo 13.03.06 20:52 
Hallo Delphianer

Im ListView habe ich zwei TListItems Süsswasserreport und Meerwasserreport. Mein Problem ist wenn, ich das SüsswasserItem kommt immer der Report vom Meerwasser.
Hier ist mal mein Code

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
procedure TForm29.Button2Click(Sender: TObject);
begin
  frReport1.ShowReport;
end;

procedure TForm29.Button1Click(Sender: TObject);
begin
  FRReport1.DesignReport;
end;

procedure TForm29.ListView1SelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
begin
if selected then
  ListView1.Items.Item[0];
  Path22 := ExtractFilePath(Application.ExeName)+'Report\Reportsüss.frf';
  frReport1.LoadFromFile(Path22);

if selected then
  ListView1.Items.Item[1];
  Path23 := ExtractFilePath(Application.ExeName)+'Report\Reportmeer.frf';
  frReport1.LoadFromFile(Path23);
end;

was mache ich hier Falsch

MfG
Tabakbrummel
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mo 13.03.06 21:02 
select ist immer wahr!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm29.ListView1SelectItem(Sender: TObject; Item: TListItem;  
  Selected: Boolean);  
begin  
  if compareText(Item.Caption,'Süsswasser')=0 then
    Path22 := ExtractFilePath(Application.ExeName)+'Report\Reportsüss.frf'
  else
    Path23 := ExtractFilePath(Application.ExeName)+'Report\Reportmeer.frf';  

  frReport1.LoadFromFile(Path22);  
end;


passe ggf. noch den Vergleich an

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Tabakbrummel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Mo 13.03.06 21:28 
Hallo MSCH

Erst mal danke für deine Antwort.
Jetzt ist aber das Problem, er gibt mir jetzt eine Exception. Exception-Klasse EFOpenError mit Meldung 'Datei kann nicht geöffnet werden. Das System kann den angegebenen Pfad nicht finden'.Obwohl der Pfad es gibt.

MfG
Tabakbrummel
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 14.03.06 20:44 
versuchs mal damit;

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm29.ListView1SelectItem(Sender: TObject; Item: TListItem;    
  Selected: Boolean);    
begin    
  if compareText(Item.Caption,'Süsswasser')=0 then  
    Path22 := IncludeTrailingBackslash(ExtractFilePath(Application.ExeName))+'Report\Reportsüss.frf'  
  else  
    Path23 := IncludeTrailingBackslash(ExtractFilePath(Application.ExeName))+'Report\Reportmeer.frf';    

   frReport1.LoadFromFile(Path22);    
end;

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?