Crystal Reports - Account Formula

I am developing a report in Crystal, and I need to do a count for a specific field that has several different statuses. For example, I have a StatusType field in my report that contains the values "In Process", "Rejected", "On Hold", or "Submitted" . I want to be able to do a count in the "StatusType" field relative to the number of "Rejected" and "Submitted" values ​​in one formula. The report is grouped by "StatusType" .

I am new to writing formulas in Crystal Reports, so I would appreciate some guidelines for getting a formula that counts these two values ​​in a field. Please let me know what additional information is needed or would be useful for my question.

I do not need to display the total for each type of state at the beginning / end of each group, but I would like it to be in the title of the page or report. I'm not sure it would be better. I would like to have an account of each status in one place of the report, and then be able to combine a pair of status indicators, such as "Rejected" and "Submitted" . None of the samples that I want to display should be within the body of the report or in the details, but rather in the title of the report / page.

+4
source share
2 answers

I think the best option here is to use RunningTotal rather than a formula.

Create a new Running Total and enter the following parameters:

  • {StatusType} Fields: {StatusType}
  • Summary Type: Count
  • Rate: check Use a Formula and click the formula button.
  • In the formula field, enter {StatusType} = "Submitted"
  • Reset: Check Never

At the moment, I do not have Crystal installed on this machine, but I think it needs to be done. Then you can simply repeat the process for the Rejected status type.

+4
source

Assuming you want to display the number of records for each status at the end of each group, you do not need to create a formula. Just:

  • Right-click on the status field.
  • Choose Paste> Summary ... from the menu.
  • Select Account as the type of summary, and group: status as the resulting location in the Insert Resume dialog box.
  • Click OK at the bottom of the Insert Summary dialog box.

A status counter will be added here in the group footer for the group of states. You can drag it to a more convenient position and / or reformat it.

0
source

Source: https://habr.com/ru/post/1390097/


All Articles