How to chain Text with field from database in Expressions.

edited July 2015 in FastReport VCL 5
Hello

my Memo looks liek that
[IIF (<frxDBDataset1."S1TAGE">=0,'',iif(<frxDBDataset1."S1TAGE">>=1,<frxDBDataset1."S1TAGE">,'FALSE'))]

this works well, however i need to Add Text in that expression and no matter what iam doing it doesnt work so far, i tried "+" and variants of known operators as well.

In Pseudocode it should look like that:
[IIF (<frxDBDataset1."S1TAGE">=0,'',iif(<frxDBDataset1."S1TAGE">>=1,<frxDBDataset1."S1TAGE">+'Tage'+<frxDBDataset1."S1Skonto"+'%'+'Skonto'>,'FALSE'))]

Result should be: 14 Tage 2% Skonto

EDIT: Got it!
[iif (<frxDBDataset1."S1TAGE">=0,'',FormatFloat('0',<frxDBDataset1."S1TAGE">)+' Tage '+FormatFloat('#,##0.00',<frxDBDataset1."S1PROZENT">)+' %')]

u CAN make strings in the iif expression, BUT ONLY if u dont mix them up with Integer values.
Otherwise you have to use FormatFloat ....

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.