> ### Task 4: Display the result

> To display the count of customers with the string Mini in their names, insert code in a method that runs after the processing of all the rows in the list. One logical place for this code is in the ReportDesign.afterFactorymethod.

> 1 | In Outline, select the report design, as shown in Figure 22-9.

> Figure 22-9 Selecting the report design in Outline

> 2 | Select the afterFactory method from the list of available scripts in the script editor.

> 3 | Type the following code into the afterFactory method:

> importPackage( Packages.javax.swing );
> frame = new JFrame( "Count of Minis = " + countOfMinis );
> frame.setBounds( 310, 220, 300, 20 );
> frame.show( );

> 4 | Select Preview to see the results. If there are no errors in the code, you see a report similar to the one in Figure 22-10.

> Figure 22-10 Result of changing the afterFactory( ) method

> If you do not see the Count of Minis window, look for it behind the Eclipse window. If the Count of Minis window does not appear, the most likely reason is a scripting error caused by an error in one of your code entries.

> If you suspect that a scripting error occurred, scroll to the bottom of the report where all scripting error messages appear. In most situations, there is a brief error message next to a plus sign ( + ). The plus sign indicates that there is a more detailed error message that is only visible after you expand the brief error message. To expand the brief error message, choose the plus sign. Scroll down to see the more detailed error message.

(c) Copyright Actuate Corporation 2013