logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Customer panel Support
    • en
    • ru
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • Handling the “Division by Zero” exception in FastReport.Net 2018.4
  • How to use Online Designer in ASP .Net Core

    January 17, 2018

    One of the novelties by FastReport .Net 2018 was the adaptation of OnlineDesigner to the

    read more
  • How to use WebReport with ASP .Net Web Core application

    January 17, 2018

    Recently FastReport introduced a new library under the .Net - FastReport Core platform. This is

    read more
  • FastCube - High-Speed OLAP Cube Engine and Pivot Grid

    February 29, 2020

    It is difficult to imagine data analysis without OLAP (On-Line Analytical Processing) technology. Although there

    read more
  • Report generators family FastReport brief review

    March 23, 2020

    Without reporting it is impossible to carry on business in any sphere of life. Bureaucracy

    read more
  • How to make a report like Drill-Down

    September 4, 2019

    Reports with grouping are necessary for data analysis. But when there are a lot of

    read more

Handling the “Division by Zero” exception in FastReport.Net 2018.4

November 5, 2018

Among the updates in FastReport 2018.4, there was a solution to the dividing by zero error. Previously, report developers had to handle this exception themselves. After all, we cannot guarantee that because of the data this error will not occur. If you have not done the division by zero processing, you will get an exception that will interrupt the construction of the report. As a result, you still have to refine the report, and this is an additional time cost.

Now, you do not need to think about this problem, in the expression where the division error by zero occurred, the message “Division by zero” will be displayed. In this case, the report is constructed. Let's compare what was and what has become when divided by zero.

Add a text field to the report and enter the following expression: [2018/0]. These are two integers.

That's what how it was in previous versions of FastReport.Net. When trying to run a report in the designer:

When running a report from a user application:

As it has become:

 

The report was constructed, but the field with an error is highlighted with a red background, replaced by the text DIVISION BY ZERO!

It works on integer values. And what if you divide numbers with a comma by zero? For example, the expression [2018.0 / 0.0] will give the result:

 

This works in the previous version and in the new one.

Thus, the built-in processing of division by zero freed us from the "headache" - to write our own handlers in the report script. So, the development of reports has become even easier and more convenient.

about product download buy
avatar
Dmitriy Fedyashov
Head of QA
.NET FastReport

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy