private void export() {
        
        if(modelCompareShipping == null) return;
        
        Integer columnCount = jTableReport.getColumnCount() == 0 ? 1 : jTableReport.getColumnCount();        
        Integer rowCount = jTableReport.getRowCount() + 5;
        Object[][] data = new Object[rowCount][columnCount];
        
        StringBuilder line = new StringBuilder();
        if(jComboBoxRegion.getSelectedIndex() == 0) {
            List<Agent> selectedAgent = modelSelectedAgent.getList();
            line.append("Клиенты: ");
            for(Agent agent : selectedAgent) {
                line.append(agent.getId() + "; ");
            }
        } else {
            line.append("Регион: " + jComboBoxRegion.getSelectedItem().toString());
            if(jRadioButtonRegionPrice.isSelected()){
                line.append(" Региональный прайс: " + ((RegionPrice) jComboBoxRegionPrice.getSelectedItem()).toString());
            }else if(jRadioButtonGroupPrice.isSelected()){
                line.append(" Групповой прайс: " + ((GroupPrice) jComboBoxGroupPrice.getSelectedItem()).toString());
            }else{
                line.append(" Все:");
            }            
        }
        
        String first = "Период 1: с " + new SimpleDateFormat(Application.TABLE_DATE).format(jXDatePickerFirstStart.getDate()) + " по " + new SimpleDateFormat(Application.TABLE_DATE).format(jXDatePickerFirstEnd.getDate());
        String second = "Период 2: с " + new SimpleDateFormat(Application.TABLE_DATE).format(jXDatePickerSecondStart.getDate()) + " по " + new SimpleDateFormat(Application.TABLE_DATE).format(jXDatePickerSecondEnd.getDate());
        
        data[0][0] = line.toString();
        data[1][0] = first;
        data[2][0] = second;
        
        JTableHeader[] headers = new JTableHeader[columnCount];
        for(int i = 0; i < columnCount; i++) {
            JTableHeader header = jTableReport.getTableHeader();
            data[4][i] = header.getColumnModel().getColumn(i).getHeaderValue();
        }
        
        for(int i = 0; i < rowCount - 5; i++) {
            for(int j = 0; j < columnCount; j++) {
                data[i + 5][j] = jTableReport.getValueAt(i, j);
            }
        }
        
        data[1][11] = "=SUBTOTAL(9,L7:L" + rowCount + ")";
        data[2][11] = "=SUBTOTAL(3,L7:L" + rowCount + ")";
        
        data[1][12] = "=SUBTOTAL(9,M7:M" + rowCount + ")";
        data[2][12] = "=SUBTOTAL(3,M7:M" + rowCount + ")";
        
        data[1][13] = "=P3*100/(P3-R3)-100";
        data[1][14] = "=Q3*100/(Q3-S3)-100";
        data[1][15] = "=SUBTOTAL(9,P7:P" + rowCount + ")";
        data[1][16] = "=SUBTOTAL(9,Q7:Q" + rowCount + ")";
        data[1][17] = "=SUBTOTAL(9,R7:R" + rowCount + ")";
        data[1][18] = "=SUBTOTAL(9,S7:S" + rowCount + ")";
        data[1][19] = "=SUBTOTAL(9,T7:T" + rowCount + ")";
        data[1][20] = "=SUBTOTAL(9,U7:U" + rowCount + ")";
        
        ServiceApplication.openOpenSaveJDialogXLS(this, data);
    }