Expression Builder?

edited 9:55AM in FastReport VCL 5
I did a search for if statements and someone said to use the expression builder. Where is that?

I'm wanting to do something like if([WO-PartDetail."Thickness"]="0.179", "7GA",""). Not sure this is even the right syntax(?)

Comments

  • edited April 2018
    Hey Galin,

    you can use IIF function in a memo like below :

    IIF(<WO-PartDetail."Thickness">=0.179,'true statement',<adoquery1."falsestatement">)

    boakoms.
    Galin wrote: »
    I did a search for if statements and someone said to use the expression builder. Where is that?

    I'm wanting to do something like if([WO-PartDetail."Thickness"]="0.179", "7GA",""). Not sure this is even the right syntax(?)
    fr2.jpg 90.2K
  • edited 9:55AM
    boakoms wrote: »
    Hey Galin,

    you can use IIF function in a memo like below :

    IIF(<WO-PartDetail."Thickness">=0.179,'true statement',<adoquery1."falsestatement">)

    boakoms.
    boakoms wrote: »
    I did a search for if statements and someone said to use the expression builder. Where is that?

    I'm wanting to do something like if([WO-PartDetail."Thickness"]="0.179", "7GA",""). Not sure this is even the right syntax(?)


    Thank you! Pictures too...it must be Friday >
  • edited 9:55AM
    boakoms wrote: »
    Hey Galin,

    you can use IIF function in a memo like below :

    IIF(<WO-PartDetail."Thickness">=0.179,'true statement',<adoquery1."falsestatement">)

    boakoms.
    boakoms wrote: »
    I did a search for if statements and someone said to use the expression builder. Where is that?

    I'm wanting to do something like if([WO-PartDetail."Thickness"]="0.179", "7GA",""). Not sure this is even the right syntax(?)


    Just adding to the solution for anyone who might benefit from this thread down the line. It seems that this program is geared towards professional devs and we "dabblers" are pretty much on our own. Hopefully this will help a fellow dabbler.

    The expression builder is in the window that pops up when you double click an element. Click on the 'abc' button and the screen above pops up.

    Here's an expression I wrote for a different issue I was working on:
    [IIF(<WO-PartDetail."PartData11">!="",<WO-PartDetail."PartData11">,<WO-PartDetail."PartUnitPriceRect">)]
    It follows IIF(condition is true, then do this, else do this)
    So if the PartData11 field is filled in (not blank / !="") then that number will be returned. If it is blank, PartUnitPriceRect will be the number that gets used.

    There is a lot of benefit in setting variables. This is done with the top menu under Report > Variables. Click on the 2nd button from the left (fx with a star), rename your new variable, and drag elements in from the Data menu. You can then call your new variable in another variable if you want. I set the above formula to a variable called ItemPrice. I used that ItemPrice variable in another variable that multiplies this with the quantity to return a grand total. This is all specific to our needs but hopefully it is helpful for yours if you're reading.

    I'm tempted to write a 101 instruction manual using real world examples and layman terms. We'll see.

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.