public void commandAction(Command c, Displayable d) {
        // help command displays Help Form.
        if (c == CMD_HELP) {
            HelpForm h = new HelpForm(this.midlet, this, "financial");
            this.midlet.display.setCurrent(h);
        }

        // exit commands comes back to main menu.
        if (c == CMD_EXIT) {
            this.midlet.display.setCurrent(this.midlet.mainMenu);
        }

        // save command
        if (c == CMD_SAVE) {

            Alert alert;

            // check whether all fields have been completed
            // if not, we alert and don't do anything else.
            if (!this.isComplete()) {
                alert = new Alert("Données manquantes", "Tous les champs doivent être remplis!", null, AlertType.ERROR);
                alert.setTimeout(Alert.FOREVER);
                this.midlet.display.setCurrent (alert, this);
                return;
            }

            // create a report object from values
            FinancialReport financial = new FinancialReport();
            financial.setAll(Integer.parseInt(intrauterine_devices_qty.getString()),
                             Integer.parseInt(intrauterine_devices_price.getString()),
                             Integer.parseInt(intrauterine_devices_revenue.getString()),
                             Integer.parseInt(implants_qty.getString()),
                             Integer.parseInt(implants_price.getString()),
                             Integer.parseInt(implants_revenue.getString()),
                             Integer.parseInt(injections_qty.getString()),
                             Integer.parseInt(injections_price.getString()),
                             Integer.parseInt(injections_revenue.getString()),
                             Integer.parseInt(pills_qty.getString()),
                             Integer.parseInt(pills_price.getString()),
                             Integer.parseInt(pills_revenue.getString()),
                             Integer.parseInt(male_condoms_qty.getString()),
                             Integer.parseInt(male_condoms_price.getString()),
                             Integer.parseInt(male_condoms_revenue.getString()),
                             Integer.parseInt(female_condoms_qty.getString()),
                             Integer.parseInt(female_condoms_price.getString()),
                             Integer.parseInt(female_condoms_revenue.getString()),
                             Integer.parseInt(hiv_tests_qty.getString()),
                             Integer.parseInt(hiv_tests_price.getString()),
                             Integer.parseInt(hiv_tests_revenue.getString()),
                             Integer.parseInt(iud_removal_qty.getString()),
                             Integer.parseInt(iud_removal_price.getString()),
                             Integer.parseInt(iud_removal_revenue.getString()),
                             Integer.parseInt(implant_removal_qty.getString()),
                             Integer.parseInt(implant_removal_price.getString()),
                             Integer.parseInt(implant_removal_revenue.getString()),
                             Integer.parseInt(emergency_controls_qty.getString()),
                             Integer.parseInt(emergency_controls_price.getString()),
                             Integer.parseInt(emergency_controls_revenue.getString()));
            // check for errors and display first error
            if (!financial.dataIsValid()) {
                alert = new Alert("Données incorrectes!", financial.errorMessage(), null, AlertType.ERROR);
                alert.setTimeout(Alert.FOREVER);
                this.midlet.display.setCurrent (alert, this);
                return;
            }

            // data appears to be valid now. Let's save it.
            financial.saveInStore();
            // refresh menu as we've changed data.
            this.midlet.refreshMenu();

            // mark report in progress
            config.set("has_data", "true");

            // Confirm data is OK and go to main menu
            alert = new Alert("Enregistré", "Les données du rapport financier ont été enregistrées", null, AlertType.CONFIRMATION);
            alert.setTimeout(Alert.FOREVER);
            this.midlet.display.setCurrent (alert, this.midlet.mainMenu);
        }
    }