private void finishPage(Graphics2D g) {

        //
        // Notify the report listeners that we are at the end of the current page
        //
        ReportEvent event = new ReportEvent(ReportEvent.PAGE_FINISHED, state);
        int expCount;
        ReportExpression exp;
        if (g != null) {
            PageState pageState = reportPages.get(pageIndex);
            expCount = pageState.getExpressionCount();
            for (int i=0; i<expCount; i++) {
                exp = pageState.getExpression(i);
                if (exp instanceof ReportListener)
                    ((ReportListener)exp).pageFinished(event);
            }
        } else {
            expCount = state.getExpressionCount();
            for (int i=0; i<expCount; i++) {
                exp = state.getExpression(i);
                if (exp instanceof ReportListener)
                    ((ReportListener)exp).pageFinished(event);
            }
        }

        //
        // Print the page footer
        //
        if (g != null) {
            ReportBand band = state.getPageFooter();
            if (band.getElementCount() != 0) {
                Rectangle bandArea = band.getBounds();
                Point p = new Point(printArea.x, printArea.y+printArea.height-bandArea.height);
                band.format(g, p);
            }
        }
    }