Conditional Field

edited 12:41PM in FastReport 4.0
Hello,

Maybe this is a stupid question, but i don't find the solution.

I've a field with a numeric value. How I can do that if the value is greater than 0 print this value with a text and if 0 doesn't print anything ?

f.e. field name is <oRs."number">

<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->if <oRs."number"> > 0 then

"Number:" + <oRs."number">

endif<!--fontc--></span><!--/fontc-->


Thanks for your support.
Carlos

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:41PM
    look at using the iif function within the memoview.
  • edited 12:41PM
    Or in the script

    field.Visible := (<oRs."number"> > 0);
  • edited 12:41PM
    Technisoft
    technisoft wrote: »
    Or in the script

    field.Visible := (<oRs."number"> > 0);

    Work great !!! --> Now, it's easy jejeje Thanks.


    Gordk.

    Your tip i can't do it, because i don't know more, but my question is... ?? Wich is the best solution of both ? One script in Code Tab or put into memoview ? I like to know the correct way for this, but of course maybe both are correct...


    Carlos
  • gordkgordk St.Catherines On. Canada.
    edited 12:41PM
    which ever works best for you.

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.