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()));
}
}
}
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;
}
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"));
}
}
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()));
}
}
}
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;
}
Aggregations