Search in sources :

Example 1 with ModifiableConfiguration

use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.

the class JFreeReportConfigParameterComponent method setReportConfigParameters.

private void setReportConfigParameters(final MasterReport report, final Map values) {
    Map.Entry ent;
    ModifiableConfiguration config = report.getReportConfiguration();
    Iterator it = values.entrySet().iterator();
    while (it.hasNext()) {
        ent = (Map.Entry) it.next();
        if ((ent.getKey() != null) && (ent.getValue() != null)) {
            config.setConfigProperty(ent.getKey().toString(), applyInputsToFormat(ent.getValue().toString()));
        }
    }
}
Also used : Iterator(java.util.Iterator) ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) Map(java.util.Map)

Example 2 with ModifiableConfiguration

use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.

the class JFreeReportPreviewSwingComponent method performExport.

@Override
protected boolean performExport(final MasterReport report) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final boolean progressBar = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR, "true".equals(reportConfiguration.getConfigProperty(// $NON-NLS-1$
    JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY)));
    final boolean progressDialog = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG, "true".equals(reportConfiguration.getConfigProperty(// $NON-NLS-1$
    JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY)));
    reportConfiguration.setConfigProperty(JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY, String.valueOf(progressDialog));
    reportConfiguration.setConfigProperty(JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY, String.valueOf(progressBar));
    final PreviewDialog dialog = createDialog(report);
    final ReportController reportController = getReportController();
    if (reportController != null) {
        dialog.setReportController(reportController);
    }
    dialog.pack();
    if (dialog.getParent() != null) {
        RefineryUtilities.centerDialogInParent(dialog);
    } else {
        RefineryUtilities.centerFrameOnScreen(dialog);
    }
    dialog.setVisible(true);
    return true;
}
Also used : ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) ReportController(org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Example 3 with ModifiableConfiguration

use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.

the class JFreeReportComponent method setReportConfigParameters.

private void setReportConfigParameters(final MasterReport report, final IPentahoResultSet values) {
    int rowCount = values.getRowCount();
    int colCount = values.getColumnCount();
    ModifiableConfiguration config = report.getReportConfiguration();
    if (colCount >= 2) {
        IPentahoMetaData md = values.getMetaData();
        // $NON-NLS-1$
        int nameIdx = md.getColumnIndex("name");
        // $NON-NLS-1$
        int valIdx = md.getColumnIndex("value");
        if (nameIdx < 0) {
            nameIdx = 0;
        }
        if (valIdx < 0) {
            valIdx = 1;
        }
        for (int i = 0; i < rowCount; i++) {
            Object[] aRow = values.getDataRow(i);
            if ((aRow[nameIdx] != null) && (aRow[valIdx] != null)) {
                config.setConfigProperty(aRow[nameIdx].toString(), applyInputsToFormat(aRow[valIdx].toString()));
            }
        }
    } else {
        // $NON-NLS-1$
        error(Messages.getInstance().getErrorString("JFreeReport.ERROR_0025_INVALID_REPORT_CONFIGURATION_PARAMETERS"));
    }
}
Also used : ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) IPentahoMetaData(org.pentaho.commons.connection.IPentahoMetaData)

Example 4 with ModifiableConfiguration

use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.

the class JFreeReportComponent method setReportConfigParameters.

private void setReportConfigParameters(final MasterReport report, final Map values) {
    Map.Entry ent;
    ModifiableConfiguration config = report.getReportConfiguration();
    Iterator it = values.entrySet().iterator();
    while (it.hasNext()) {
        ent = (Map.Entry) it.next();
        if ((ent.getKey() != null) && (ent.getValue() != null)) {
            config.setConfigProperty(ent.getKey().toString(), applyInputsToFormat(ent.getValue().toString()));
        }
    }
}
Also used : Iterator(java.util.Iterator) ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with ModifiableConfiguration

use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.

the class JFreeReportComponent method writeSwingPreview.

protected boolean writeSwingPreview(final MasterReport report) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final boolean progressBar = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR, // $NON-NLS-1$
    "true".equals(reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY)));
    final boolean progressDialog = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG, // $NON-NLS-1$
    "true".equals(reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY)));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY, String.valueOf(progressDialog));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY, String.valueOf(progressBar));
    final PreviewDialog dialog = createDialog(report);
    final ReportController reportController = getReportController();
    if (reportController != null) {
        dialog.setReportController(reportController);
    }
    dialog.pack();
    if (dialog.getParent() != null) {
        RefineryUtilities.centerDialogInParent(dialog);
    } else {
        RefineryUtilities.centerFrameOnScreen(dialog);
    }
    dialog.setVisible(true);
    return true;
}
Also used : ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) ReportController(org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Aggregations

ModifiableConfiguration (org.pentaho.reporting.libraries.base.config.ModifiableConfiguration)6 Iterator (java.util.Iterator)2 Map (java.util.Map)2 IPentahoMetaData (org.pentaho.commons.connection.IPentahoMetaData)2 PreviewDialog (org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)2 ReportController (org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController)2 HashMap (java.util.HashMap)1