Devided by zero

KikikKikik Jember
edited 4:01AM in FastReport .NET
i want to convert fastreport delphi to fastreport.net, but i have trouble.

in fastreport delphi can, but in fastreport.net cant. why?
1. Image Fastreport.net
2. Error fastreport.net
3. Fastreport delphi

Comments

  • edited 4:01AM
    1. use script to create your custom function.
    using System;
    
    namespace FastReport
    {
      public class ReportScript
      {
    
        public double MyCustomFunction(decimal amount, int quantity)
        {
           if (quantity == 0)
            return 0;
           else
            return ((double) amount / (double) quantity);
        }
      }
    }
    

    2. then call it from textobject

    [MyCustomFunction([Products.Amount],[Products.Quantity])]

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.