Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Fastreport Memo mit Bedingung (https://www.delphipraxis.net/52534-fastreport-memo-mit-bedingung.html)

meierotto 30. Aug 2005 15:22


Fastreport Memo mit Bedingung
 
Hallo :-D ,

ich arbeite z.Z. etwas intensiver mit Fastreport.
Nun möchte ich in einem Memofeld mehrere Datenfelder kombinieren, das ist kein Problem mit:
Code:
[<frxDBDSMaster."TITEL">] [<frxDBDSMaster."VORNAME">] [<frxDBDSMaster."NAME1">]
Ich möchte aber z.B. Titel + Leerzeichen nur anzeigen, wenn in Titel auch etwas steht.
Kann ich hier mit if-Bedingungen arbeiten? :gruebel:

Danke im Voraus.

alex517 31. Aug 2005 08:05

Re: Fastreport Memo mit Bedingung
 
Hi,

versuchs doch mal damit:
Delphi-Quellcode:
[TRIM([<frxDBDSMaster."TITEL">]+' '+[<frxDBDSMaster."VORNAME">]+' '+[<frxDBDSMaster."NAME1">])]
Man kann aber auch IF(..) einsetzen.

alex

meierotto 1. Sep 2005 07:56

Re: Fastreport Memo mit Bedingung
 
Danke alex517,

dass mit dem Trim ist eine super Variante :thumb: .
Trotzdem würde mich sehr interessieren, wie ich das IF(..) einsetzen kann.
Kannst du dazu vielleicht nochmal was schreiben?

Marcel Gascoyne 1. Sep 2005 08:17

Re: Fastreport Memo mit Bedingung
 
Zitat:

Zitat von meierotto
Ich möchte aber z.B. Titel + Leerzeichen nur anzeigen, wenn in Titel auch etwas steht.
Kann ich hier mit if-Bedingungen arbeiten? :gruebel:

Versuch es doch mal so:

Delphi-Quellcode:
if LENGTH([frxDBDSMaster."TITEL"]) > 0 then
  Memo1.Memo := [frxDBDSMaster."TITEL"] + [frxDBDSMaster."VORNAME"] + [frxDBDSMaster."NAME1"]
else
  Memo1.Memo := [frxDBDSMaster."VORNAME"] + [frxDBDSMaster."NAME1"];
Gruß,
Marcel

alex517 1. Sep 2005 14:25

Re: Fastreport Memo mit Bedingung
 
oder so mit der IF-Funktion:
Code:
[IF(TRIM([frxDBDSMaster."TITEL"])<>'', [frxDBDSMaster."TITEL"]+' ', '')][frxDBDSMaster."NAME1"]
alex


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:20 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