'How to get count of additional forms using C#.Net or SQL?

Scenario: I have 3 pages in the report(pdf) which I am designing and developing using DevExpress XtraReports and C#.NET.

First Page(Page1.cs) fields includes :

Count of Additional Forms - ______________

Manufacturer - _________________

Nominal Voltage - ______________

Second Page(Page2.cs) fields includes :

Battery - ______________

Third Page(Page3.cs) fields includes :

Defects - _______________

Now, If Manufacturer contains any value, One additional form will be appended to my report. And Nominal Voltage contains any value, One more additional form will be appended to my report. And Battery contains any value, One more additional form will be appended to my report. And Defects contains any value, One more additional form will be appended to my report.

So the count of Additional forms is 4. The count should be displayed as 4 in the field which is the Page 1. Count of Additional Forms - __4

Is there any way to achieve this using SQL Query or C#.Net code? Challenge is I have different .cs files for each page and different object is created for all 3 Pages.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source